OSDN Git Service

Fix NPE from empty PackageInfo
authorAlexandra Gherghina <alexgherghina@google.com>
Fri, 29 Aug 2014 12:43:59 +0000 (13:43 +0100)
committerAlexandra Gherghina <alexgherghina@google.com>
Thu, 4 Sep 2014 14:46:23 +0000 (15:46 +0100)
Bug: 17325905
Change-Id: I38ae5e242b1bf615620cf069a2cccede6ee42125

core/java/android/app/ApplicationPackageManager.java

index 6843827..e2def31 100644 (file)
@@ -1640,7 +1640,10 @@ final class ApplicationPackageManager extends PackageManager {
         if (itemInfo.showUserIcon != UserHandle.USER_NULL) {
             return new BitmapDrawable(getUserManager().getUserIcon(itemInfo.showUserIcon));
         }
-        Drawable dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo);
+        Drawable dr = null;
+        if (itemInfo.packageName != null) {
+            dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo);
+        }
         if (dr == null) {
             dr = itemInfo.loadDefaultIcon(this);
         }