Skip to content

Commit 3498b3b

Browse files
axe-fbfacebook-github-bot
authored andcommitted
Check null values in shouldAnimate
Summary: Looks like there could be cases when the NativeHirearchyManager may be asking if it should animate on a view that has been removed. Adding a null check Changelog: [General] [Fixed] - Check null values in shouldAnimate Reviewed By: makovkastar Differential Revision: D20063054 fbshipit-source-id: 5b3b1c27b9aba57a592bd8d4e27a970cf0912b5d
1 parent 8ae3174 commit 3498b3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.java

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public boolean shouldAnimateLayout(View viewToAnimate) {
8888
// resume when view is re-attached to parent, which is the standard android animation behavior.
8989
// If there's a layout handling animation going on, it should be animated nonetheless since the
9090
// ongoing animation needs to be updated.
91+
if (viewToAnimate == null) {
92+
return false;
93+
}
9194
return (mShouldAnimateLayout && viewToAnimate.getParent() != null)
9295
|| mLayoutHandlers.get(viewToAnimate.getId()) != null;
9396
}

0 commit comments

Comments
 (0)