From e33d550ba6aaf91609d298b695e47cbf2ac29a1a Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 8 Jun 2018 14:17:38 +0200 Subject: [PATCH] catch all exceptions thrown during focus or zoom --- .../simplemobiletools/camera/views/PreviewCameraTwo.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt index 0aae35d0..6f6e9bec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt @@ -115,12 +115,18 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie mCaptureSession != null && Math.abs(event.x - mDownEventAtX) < CLICK_DIST && Math.abs(event.y - mDownEventAtY) < CLICK_DIST) { - focusArea(event.x, event.y) + try { + focusArea(event.x, event.y) + } catch (e: Exception) { + } } } if (mIsZoomSupported && event.pointerCount > 1 && mCaptureSession != null) { - handleZoom(event) + try { + handleZoom(event) + } catch (e: Exception) { + } } true }