From 99a37f137dd3ad15db1cc9b310591e1d50c601b5 Mon Sep 17 00:00:00 2001 From: Dan Sandler Date: Tue, 9 Jun 2015 14:34:38 -0400 Subject: [PATCH] Null check when reconstituting legacy icon data. Bug: 21353798 Change-Id: I07f6c7310d4589128b175759f737cf902585f97e --- .../service/notification/NotificationListenerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index b8493d4a05cf5..8c6cd09a81443 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -646,7 +646,7 @@ public abstract class NotificationListenerService extends Service { private void createLegacyIconExtras(Notification n) { Icon smallIcon = n.getSmallIcon(); Icon largeIcon = n.getLargeIcon(); - if (smallIcon.getType() == Icon.TYPE_RESOURCE) { + if (smallIcon != null && smallIcon.getType() == Icon.TYPE_RESOURCE) { n.extras.putInt(Notification.EXTRA_SMALL_ICON, smallIcon.getResId()); n.icon = smallIcon.getResId(); }