diff --git a/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt b/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt index 37b3192..0e91258 100644 --- a/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt +++ b/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt @@ -140,14 +140,12 @@ class TfliteFlutterHelperPlugin : FlutterPlugin, } } - override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, - grantResults: IntArray?): Boolean { + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, + grantResults: IntArray): Boolean { when (requestCode) { AUDIO_RECORD_PERMISSION_CODE -> { - if (grantResults != null) { - permissionToRecordAudio = grantResults.isNotEmpty() && - grantResults[0] == PackageManager.PERMISSION_GRANTED - } + permissionToRecordAudio = grantResults.isNotEmpty() && + grantResults[0] == PackageManager.PERMISSION_GRANTED completeInitializeRecorder() return true }