diff options
author | Michael W <baddaemon87@gmail.com> | 2016-10-22 13:04:55 +0200 |
---|---|---|
committer | Daniel Hillenbrand <codeworkx@cyanogenmod.org> | 2016-11-04 13:13:35 -0700 |
commit | b1c9efb6550a7e39ec41c00b08f853279b855ce9 (patch) | |
tree | d6534c9c5c611781e3cbf526868f8b53d0b6d20c | |
parent | 57e73c474580531513c016f76bb486190685173d (diff) | |
download | android_packages_apps_AudioFX-b1c9efb6550a7e39ec41c00b08f853279b855ce9.tar.gz android_packages_apps_AudioFX-b1c9efb6550a7e39ec41c00b08f853279b855ce9.tar.bz2 android_packages_apps_AudioFX-b1c9efb6550a7e39ec41c00b08f853279b855ce9.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
-rw-r--r-- | src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java | 4 |
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 582e3d6..3f6affc 100644 --- a/src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java +++ b/src/org/cyanogenmod/audiofx/fragment/AudioFxFragment.java @@ -328,7 +328,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()); } |