summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2016-10-22 14:47:09 +0200
committerArne Coucheron <arco68@gmail.com>2018-01-26 01:07:43 +0100
commit1ae5e1cd54103f010ac6f4b636a0ad0807d42422 (patch)
tree5b055da9a66be799d185b8ecc028ad5bbf4ddc79
parent03b2cac768beeee3644e4902ff331987f901b410 (diff)
downloadandroid_packages_apps_Snap-1ae5e1cd54103f010ac6f4b636a0ad0807d42422.zip
android_packages_apps_Snap-1ae5e1cd54103f010ac6f4b636a0ad0807d42422.tar.gz
android_packages_apps_Snap-1ae5e1cd54103f010ac6f4b636a0ad0807d42422.tar.bz2
Snap: Fix possible NPE
Seems like getSupportedFocusModes() can return null. Check for null before using it further Change-Id: I46860f780b99970cbe9857c8ba73691d69321488 Reference: BugDumps 20161014-20 L#131
-rw-r--r--src/com/android/camera/PhotoModule.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 6ba9d45..665e3db 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -5155,8 +5155,10 @@ public class PhotoModule
mAeLockSupported = CameraUtil.isAutoExposureLockSupported(mInitialParams);
mAwbLockSupported = CameraUtil.isAutoWhiteBalanceLockSupported(mInitialParams);
- if (mInitialParams.getSupportedFocusModes().contains(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE) ||
- mInitialParams.getSupportedFocusModes().contains(CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE)) {
+ List<String> focusModes = mInitialParams.getSupportedFocusModes();
+ if (focusModes != null &&
+ (focusModes.contains(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE) ||
+ focusModes.contains(CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE))) {
mContinuousFocusSupported = true;
} else {
mContinuousFocusSupported = false;