From c74d3ee93806b1e60d683b383a45657bd40f742c Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Mon, 18 Jan 2016 14:16:36 -0800 Subject: SnapdragonCamera: Fix NULL pointer exception There is a corner case that onShutterButtonClick() is called before camera device is configured. The change will make sure the camera device exists before continuing the operation. Change-Id: I2212572ea5c6073c3f62bdd38e83716b2427c87d CRs-Fixed: 962579 --- src/com/android/camera/PhotoModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 2fbe768b0..3e5e9bfb9 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -2083,7 +2083,8 @@ public class PhotoModule @Override public synchronized void onShutterButtonClick() { - if (mPaused || mShutterPressing + if ((mCameraDevice == null) + || mPaused || mShutterPressing || mUI.collapseCameraControls() || (mCameraState == SWITCHING_CAMERA) || (mCameraState == PREVIEW_STOPPED) -- cgit v1.2.3