Add null checks for dynamics

Reviewed By: ahmedre

Differential Revision: D4400532

fbshipit-source-id: d6e503ca39fe1cf90baaf52348b6fa3130f76fb8
This commit is contained in:
Emil Sjolander
2017-01-11 03:58:05 -08:00
committed by Facebook Github Bot
parent 3f49e743be
commit b15c042a21
4 changed files with 41 additions and 20 deletions

View File

@@ -42,6 +42,14 @@ public class DynamicFromArray implements Dynamic {
sPool.release(this);
}
@Override
public boolean isNull() {
if (mArray == null) {
throw new IllegalStateException("This dynamic value has been recycled");
}
return mArray.isNull(mIndex);
}
@Override
public boolean asBoolean() {
if (mArray == null) {