diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java index db0d0941bb0f7e..7bd6dc90ed432b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java @@ -172,8 +172,13 @@ public void invoke(Object... args) { public boolean onRequestPermissionsResult( int requestCode, String[] permissions, int[] grantResults) { try { - mCallbacks.get(requestCode).invoke(grantResults, getPermissionAwareActivity()); - mCallbacks.remove(requestCode); + Callback callback = mCallbacks.get(requestCode); + if (callback != null) { + callback.invoke(grantResults, getPermissionAwareActivity()); + mCallbacks.remove(requestCode); + } else { + FLog.w("PermissionsModule", "Unable to find callback with requestCode %d", requestCode); + } return mCallbacks.size() == 0; } catch (IllegalStateException e) { FLog.e(