diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java index 563a0a7e43e13..31656a00c3eda 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/PhysicsAnimationLayout.java @@ -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