From 58543f1dd45afb1a70c594f41f9f703b8b0b8eaa Mon Sep 17 00:00:00 2001 From: Daniel Nishi Date: Wed, 1 Feb 2017 14:19:28 -0800 Subject: [PATCH] Don't crash in Music Storage Settings. This crash occurs because the music files entry is active, but does not have an AppEntry (because it is not an app.) ManageApplications assumes all active elements have an AppEntry, which causes an NPE. By adding in a null check, we can avoid this. Bug: 34888282 Test: Manual -- because ManageApplications needs refactoring badly. Change-Id: Ief0c202f6176d90e492e62e5930b940e5a28b95c --- src/com/android/settings/applications/ManageApplications.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index 443ce348b46..97f36c37884 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -1139,6 +1139,9 @@ public class ManageApplications extends InstrumentedPreferenceFragment public void onPackageSizeChanged(String packageName) { for (int i = 0; i < mActive.size(); i++) { AppViewHolder holder = (AppViewHolder) mActive.get(i).getTag(); + if (holder == null) { + continue; + } ApplicationInfo info = holder.entry.info; if (info == null) { continue;