Skip to content

Commit 30e6836

Browse files
committed
fix: 修正 crash 問題
1 parent 74f1e6c commit 30e6836

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ public void onPermissionRequest(final PermissionRequest request) {
212212

213213
// If all the permissions are already granted, send the response to the WebView synchronously
214214
if (requestedAndroidPermissions.isEmpty()) {
215-
request.grant(grantedPermissions.toArray(new String[0]));
216-
grantedPermissions = null;
215+
if (!grantedPermissions.isEmpty()) {
216+
request.grant(grantedPermissions.toArray(new String[0]));
217+
grantedPermissions = null;
218+
}
217219
return;
218220
}
219221

0 commit comments

Comments
 (0)