diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index 8a8f221ce..6f2818287 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -40,7 +40,7 @@ var animChecker = createStrictShapeTypeChecker({ initialVelocity: PropTypes.number, type: PropTypes.oneOf( Object.keys(Types) - ), + ).isRequired, property: PropTypes.oneOf( // Only applies to create/delete Object.keys(Properties) ), diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AbstractLayoutAnimation.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AbstractLayoutAnimation.java index c29d7ae0b..8d234269a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AbstractLayoutAnimation.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AbstractLayoutAnimation.java @@ -61,8 +61,10 @@ import com.facebook.react.uimanager.IllegalViewOperationException; AnimatedPropertyType.fromString(data.getString("property")) : null; mDurationMs = data.hasKey("duration") ? data.getInt("duration") : globalDuration; mDelayMs = data.hasKey("delay") ? data.getInt("delay") : 0; - mInterpolator = data.hasKey("type") ? - getInterpolator(InterpolatorType.fromString(data.getString("type"))) : null; + if (!data.hasKey("type")) { + throw new IllegalArgumentException("Missing interpolation type."); + } + mInterpolator = getInterpolator(InterpolatorType.fromString(data.getString("type"))); if (!isValid()) { throw new IllegalViewOperationException("Invalid layout animation : " + data);