OSDN Git Service

Null check when reconstituting legacy icon data.
authorDan Sandler <dsandler@android.com>
Tue, 9 Jun 2015 18:34:38 +0000 (14:34 -0400)
committerDan Sandler <dsandler@android.com>
Tue, 9 Jun 2015 18:34:38 +0000 (14:34 -0400)
Bug: 21353798
Change-Id: I07f6c7310d4589128b175759f737cf902585f97e

core/java/android/service/notification/NotificationListenerService.java

index b8493d4..8c6cd09 100644 (file)
@@ -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();
         }