Merge "Check if the animation is null before trying to start it."

This commit is contained in:
Josh Tsuji
2020-01-14 16:40:51 +00:00
committed by Android (Google) Code Review

View File

@@ -961,6 +961,13 @@ public class PhysicsAnimationLayout extends FrameLayout {
if (view != null) {
final SpringAnimation animation =
(SpringAnimation) view.getTag(getTagIdForProperty(property));
// If the animation is null, the view was probably removed from the layout before
// the animation started.
if (animation == null) {
return;
}
if (afterCallbacks != null) {
animation.addEndListener(new OneTimeEndListener() {
@Override