Use isNotEmpty
instead of size > 0
This commit is contained in:
parent
ed754b1ac3
commit
ae1dde1993
@ -289,7 +289,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
|||||||
val currentRequestCode = RequestCode++
|
val currentRequestCode = RequestCode++
|
||||||
val listener = PermissionListener { requestCode: Int, _: Array<String>, grantResults: IntArray ->
|
val listener = PermissionListener { requestCode: Int, _: Array<String>, grantResults: IntArray ->
|
||||||
if (requestCode == currentRequestCode) {
|
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))
|
promise.resolve(parsePermissionStatus(permissionStatus))
|
||||||
return@PermissionListener true
|
return@PermissionListener true
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
|||||||
val currentRequestCode = RequestCode++
|
val currentRequestCode = RequestCode++
|
||||||
val listener = PermissionListener { requestCode: Int, _: Array<String>, grantResults: IntArray ->
|
val listener = PermissionListener { requestCode: Int, _: Array<String>, grantResults: IntArray ->
|
||||||
if (requestCode == currentRequestCode) {
|
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))
|
promise.resolve(parsePermissionStatus(permissionStatus))
|
||||||
return@PermissionListener true
|
return@PermissionListener true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user