catching some exceptions

This commit is contained in:
tibbi 2021-04-16 22:13:49 +02:00
parent 773d11d40a
commit 78467a051a
1 changed files with 10 additions and 2 deletions

View File

@ -184,7 +184,11 @@ class MyCameraImpl(val context: Context) {
if (isMarshmallow) { if (isMarshmallow) {
toggleMarshmallowFlashlight(true) toggleMarshmallowFlashlight(true)
} else { } else {
if (camera == null || params == null || camera!!.parameters == null) { try {
if (camera == null || params == null || camera!!.parameters == null) {
return
}
} catch (e: Exception) {
return return
} }
@ -209,7 +213,11 @@ class MyCameraImpl(val context: Context) {
if (isMarshmallow) { if (isMarshmallow) {
toggleMarshmallowFlashlight(false) toggleMarshmallowFlashlight(false)
} else { } else {
if (camera == null || params == null || camera!!.parameters == null) { try {
if (camera == null || params == null || camera!!.parameters == null) {
return
}
} catch (e: Exception) {
return return
} }