summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2016-10-22 14:47:09 +0200
committerDaniel Hillenbrand <codeworkx@cyanogenmod.org>2016-11-04 13:18:02 -0700
commit3da1aa3b6b69710ed41ba78f01005b7cd172942f (patch)
tree52e7b0efc88fed14b29c667086b0142902972bef
parent72e249c3b8b740de3608ddbade64d9c248321723 (diff)
downloadandroid_packages_apps_Snap-3da1aa3b6b69710ed41ba78f01005b7cd172942f.zip
android_packages_apps_Snap-3da1aa3b6b69710ed41ba78f01005b7cd172942f.tar.gz
android_packages_apps_Snap-3da1aa3b6b69710ed41ba78f01005b7cd172942f.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 (cherry picked from commit 537e5226c4f392c6ce0531882822b04db621d071)
-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 7f08d78..7cad029 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -4621,8 +4621,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;