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
This commit is contained in:
Ram N
2020-02-27 09:22:13 -08:00
committed by Facebook Github Bot
parent 8ae3174873
commit 3498b3b96b
@@ -88,6 +88,9 @@ public class LayoutAnimationController {
// 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;
}