Skip to content

Commit 4262e0c

Browse files
committed
catch exceptions thrown at startPreview
1 parent 0aa6493 commit 4262e0c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • app/src/main/kotlin/com/simplemobiletools/camera

app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
336336
private fun resumePreview() {
337337
mIsPreviewShown = false
338338
mActivity.toggleBottomButtons(false)
339-
mCamera?.startPreview()
339+
try {
340+
mCamera?.startPreview()
341+
} catch (e: Exception) {
342+
}
340343
mCanTakePicture = true
341344
focusArea(false, false)
342345
}

0 commit comments

Comments
 (0)