Merge "Guard against app info crash" into nyc-dev
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 3679699..14277c9 100755
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -52,7 +52,6 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
-import android.service.notification.NotificationListenerService;
 import android.service.notification.NotificationListenerService.Ranking;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.Preference.OnPreferenceClickListener;
@@ -936,7 +935,7 @@
     }
 
     private boolean hasPermission(String permission) {
-        if (mPackageInfo.requestedPermissions == null) {
+        if (mPackageInfo == null || mPackageInfo.requestedPermissions == null) {
             return false;
         }
         for (int i = 0; i < mPackageInfo.requestedPermissions.length; i++) {