From 779955390ca635db90185af573897c5235678f6b Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 10 Jun 2020 15:36:52 -0500 Subject: [PATCH] Add null check before updating animation progress Haven't been able to reproduce it locally, but seems theoretically possible if we get an onDrag() event right after something else cancels the animation (which clears the animation controller). Bug: 157900227 Change-Id: Ia134aa948e62d39f71e41dd4e6b98f3227ae0522 --- .../launcher3/touch/AbstractStateChangeTouchController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index 2c21609fa6..171c5ee4e4 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -310,6 +310,9 @@ public abstract class AbstractStateChangeTouchController } protected void updateProgress(float fraction) { + if (mCurrentAnimation == null) { + return; + } mCurrentAnimation.setPlayFraction(fraction); if (mAtomicComponentsController != null) { // Make sure we don't divide by 0, and have at least a small runway.