From 97900fb0ec6d2e266ff0af68097a60170c47701f Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 15 Sep 2022 17:07:24 +0700 Subject: [PATCH] Fix exception to allow compilation --- .../main/java/com/xlythe/view/camera/v2/Camera2Module.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camera-view/src/main/java/com/xlythe/view/camera/v2/Camera2Module.java b/camera-view/src/main/java/com/xlythe/view/camera/v2/Camera2Module.java index 8130592..6cb9782 100644 --- a/camera-view/src/main/java/com/xlythe/view/camera/v2/Camera2Module.java +++ b/camera-view/src/main/java/com/xlythe/view/camera/v2/Camera2Module.java @@ -274,7 +274,9 @@ public void close() { if (mCaptureSession != null) { try { mCaptureSession.close(); - } catch (CameraAccessException e) { + } catch (Exception e) { + // Instance of CameraAccessException (although not declared). + // Nothing we can do but swallow it. Log.e(TAG, "Failed to close camera", e); } mCaptureSession = null;