diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java index 0b44c80bc0989..f2e6abcaade9b 100644 --- a/services/core/java/com/android/server/wm/InputMonitor.java +++ b/services/core/java/com/android/server/wm/InputMonitor.java @@ -580,9 +580,12 @@ final class InputMonitor { if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) { if (recentsAnimationController.updateInputConsumerForApp( mRecentsAnimationInputConsumer.mWindowHandle)) { - mRecentsAnimationInputConsumer.show(mInputTransaction, - recentsAnimationController.getHighestLayerWindow()); - mAddRecentsAnimationInputConsumerHandle = false; + final WindowState highestLayerWindow = + recentsAnimationController.getHighestLayerWindow(); + if (highestLayerWindow != null) { + mRecentsAnimationInputConsumer.show(mInputTransaction, highestLayerWindow); + mAddRecentsAnimationInputConsumerHandle = false; + } } }