Skip to content

Commit

Permalink
Check null values in shouldAnimate
Browse files Browse the repository at this point in the history
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
  • Loading branch information
axe-fb authored and facebook-github-bot committed Feb 27, 2020
1 parent 8ae3174 commit 3498b3b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3498b3b

Please sign in to comment.