mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-06-05 21:59:19 +02:00
catching some exceptions
This commit is contained in:
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user