From dccc85e0a1d5f0ec53c1b7fc6b70ff39b81483d9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 31 Mar 2018 23:11:12 +0200 Subject: [PATCH] catch exceptions thrown at setting camera parameters --- .../main/kotlin/com/simplemobiletools/camera/views/Preview.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt index 65f72d02..16c82b7e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt @@ -411,12 +411,12 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan return@autoFocus } - camera.cancelAutoFocus() + mCamera!!.cancelAutoFocus() if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) { mParameters!!.focusMode = Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE } - camera.parameters = mParameters + updateCameraParameters() if (takePictureAfter) { takePicture()