From 5bf19edb1a56688ebec74d8e1915b78416dd318c Mon Sep 17 00:00:00 2001 From: Philip Junker Date: Tue, 13 Apr 2021 19:31:29 +0200 Subject: [PATCH] Avoid null pointer exception when calling NotificationShadeWindowControllerImpl#dump Fix: 185470518 Test: manual Change-Id: I3a345929ed09e895f54622bd151a60f0c9acab31 (cherry picked from commit bc2ce2a66455c0e4390207d5e6e3272903fdd0a2) --- .../phone/NotificationShadeWindowControllerImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java index 5aecb727517fa..0c8122cc9afb6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java @@ -666,7 +666,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW pw.println(TAG + ":"); pw.println(" mKeyguardDisplayMode=" + mKeyguardDisplayMode); pw.println(mCurrentState); - mNotificationShadeView.getViewRootImpl().dump(" ", pw); + if (mNotificationShadeView != null && mNotificationShadeView.getViewRootImpl() != null) { + mNotificationShadeView.getViewRootImpl().dump(" ", pw); + } } @Override