catch IllegalArgumentException when accessing torch

This commit is contained in:
Josia Pietsch 2025-05-12 13:42:04 +02:00
parent 4d61557a70
commit b5b65a4c42
Signed by: jrpie
GPG key ID: E70B571D66986A2D

View file

@ -78,7 +78,8 @@ class TorchManager(context: Context) {
cameraManager.setTorchMode(camera, !torchEnabled)
}
} catch (e: CameraAccessException) {
} catch (e: Exception) {
// CameraAccessException, IllegalArgumentException
Toast.makeText(
context,
context.getString(R.string.alert_torch_access_exception),