mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 22:56:32 +08:00
Add null checks for dynamics
Reviewed By: ahmedre Differential Revision: D4400532 fbshipit-source-id: d6e503ca39fe1cf90baaf52348b6fa3130f76fb8
This commit is contained in:
committed by
Facebook Github Bot
parent
3f49e743be
commit
b15c042a21
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user