summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2016-10-22 13:04:55 +0200
committerDaniel Hillenbrand <codeworkx@cyanogenmod.org>2016-11-04 13:18:58 -0700
commit6ec5081cc26454b9e8a6c059dcf23093bd517831 (patch)
tree6cf409e80bb5c8816f7951dac90f0cda1b105a3c
parent98931b9e1d5d76513a94f8a999cbd0c04c1c87b4 (diff)
downloadandroid_packages_apps_AudioFX-6ec5081cc26454b9e8a6c059dcf23093bd517831.tar.gz
android_packages_apps_AudioFX-6ec5081cc26454b9e8a6c059dcf23093bd517831.tar.bz2
android_packages_apps_AudioFX-6ec5081cc26454b9e8a6c059dcf23093bd517831.zip
AudioFX: Fix possible NPE
The only reliable thing is the initialisation with null -> if it will not be overriden in any of the loops, the call to setChecked() causes an NPE. Wrap the operation with a null check Change-Id: I7aaacf9f5ae53434643df1c477c8ea536f8602ff Reference: BugDumps 13-20161014-20 L#11 (cherry picked from commit b1c9efb6550a7e39ec41c00b08f853279b855ce9)
-rw-r--r--src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java b/src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java
index 89e4b91..babf045 100644
--- a/src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java
+++ b/src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java
@@ -327,7 +327,9 @@ public class AudioFxFragment extends Fragment implements StateCallbacks.DeviceCh
}
}
mMenuDevices.getSubMenu().setGroupCheckable(R.id.devices, true, true);
- selectedItem.setChecked(true);
+ if (selectedItem != null) {
+ selectedItem.setChecked(true);
+ }
mMenuDevices.setIcon(selectedItem.getIcon());
}