Fix NPE in NotificationRemoteInputManager logging

Test: atest
Bug: 159690333
Change-Id: I9e0edbea718961a87f7210a7f390ea0b3b5b8e13
This commit is contained in:
Ned Burns
2020-06-26 18:10:34 -04:00
parent 6f64b30362
commit e2fe52c2c0

View File

@@ -181,11 +181,11 @@ public class NotificationRemoteInputManager implements Dumpable {
return;
}
ViewParent parent = view.getParent();
StatusBarNotification statusBarNotification = entry.getSbn();
if (statusBarNotification == null) {
if (entry == null) {
Log.w(TAG, "Couldn't determine notification for click.");
return;
}
StatusBarNotification statusBarNotification = entry.getSbn();
String key = statusBarNotification.getKey();
int buttonIndex = -1;
// If this is a default template, determine the index of the button.