diff --git a/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt b/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt index f32570d..cda4469 100644 --- a/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt +++ b/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt @@ -289,7 +289,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase val currentRequestCode = RequestCode++ val listener = PermissionListener { requestCode: Int, _: Array, grantResults: IntArray -> if (requestCode == currentRequestCode) { - val permissionStatus = if (grantResults.size > 0) grantResults[0] else PackageManager.PERMISSION_DENIED + val permissionStatus = if (grantResults.isNotEmpty()) grantResults[0] else PackageManager.PERMISSION_DENIED promise.resolve(parsePermissionStatus(permissionStatus)) return@PermissionListener true } @@ -308,7 +308,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase val currentRequestCode = RequestCode++ val listener = PermissionListener { requestCode: Int, _: Array, grantResults: IntArray -> if (requestCode == currentRequestCode) { - val permissionStatus = if (grantResults.size > 0) grantResults[0] else PackageManager.PERMISSION_DENIED + val permissionStatus = if (grantResults.isNotEmpty()) grantResults[0] else PackageManager.PERMISSION_DENIED promise.resolve(parsePermissionStatus(permissionStatus)) return@PermissionListener true }