From 899557c048ac35f69d7ed04ce826eb836a8dcbbc Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 13 Dec 2019 15:20:27 -0800 Subject: [PATCH] Add null check before updating NotificationItemView It's possible that the notifications were removed between the popup opening and updating its UI. In that case, mNotificationItemView will be null. Bug: 146152941 Change-Id: I60b44ea6d766720613cf2f25481fa3fc17cab6af --- .../android/launcher3/popup/PopupContainerWithArrow.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index e70673a5a0..d2d48ca7a5 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -37,7 +37,6 @@ import android.os.Build; import android.os.Handler; import android.os.Looper; import android.util.AttributeSet; -import android.util.Log; import android.util.Pair; import android.view.MotionEvent; import android.view.View; @@ -66,7 +65,6 @@ import com.android.launcher3.notification.NotificationKeyData; import com.android.launcher3.popup.PopupDataProvider.PopupDataChangeListener; import com.android.launcher3.shortcuts.DeepShortcutView; import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider; -import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.ItemClickHandler; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.util.PackageUserKey; @@ -339,7 +337,9 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource, } public void applyNotificationInfos(List notificationInfos) { - mNotificationItemView.applyNotificationInfos(notificationInfos); + if (mNotificationItemView != null) { + mNotificationItemView.applyNotificationInfos(notificationInfos); + } } private void updateHiddenShortcuts() {