From 3498b3b96b2e27c7c7f6407b3673b44540871a31 Mon Sep 17 00:00:00 2001 From: Ram N Date: Thu, 27 Feb 2020 09:18:48 -0800 Subject: [PATCH] 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 --- .../uimanager/layoutanimation/LayoutAnimationController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.java index a63e42e29f8cad..046d757e2af941 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/LayoutAnimationController.java @@ -88,6 +88,9 @@ public boolean shouldAnimateLayout(View viewToAnimate) { // resume when view is re-attached to parent, which is the standard android animation behavior. // If there's a layout handling animation going on, it should be animated nonetheless since the // ongoing animation needs to be updated. + if (viewToAnimate == null) { + return false; + } return (mShouldAnimateLayout && viewToAnimate.getParent() != null) || mLayoutHandlers.get(viewToAnimate.getId()) != null; }