Fix Settings crash in Storage settings.

If you tap aggressively before the fragment has fully initialized, it
was possible to NPE. This null-checks to avoid this.

Change-Id: I3488245d230cf1e16b23e34614c8e6b43ea14ff1
Fixes: 37945253
Test: Robotest
This commit is contained in:
Daniel Nishi
2017-05-03 13:36:36 -07:00
parent 833927929e
commit 8381755263
2 changed files with 24 additions and 0 deletions

View File

@@ -300,6 +300,10 @@ public class StorageItemPreferenceController extends PreferenceController {
}
private Intent getAudioIntent() {
if (mVolume == null) {
return null;
}
Bundle args = new Bundle();
args.putString(ManageApplications.EXTRA_CLASSNAME,
Settings.StorageUseActivity.class.getName());
@@ -312,6 +316,10 @@ public class StorageItemPreferenceController extends PreferenceController {
}
private Intent getAppsIntent() {
if (mVolume == null) {
return null;
}
Bundle args = new Bundle();
args.putString(ManageApplications.EXTRA_CLASSNAME,
Settings.StorageUseActivity.class.getName());