Skip to content

Commit

Permalink
fix(android): handle empty permission list (#6375)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored and markemer committed Apr 17, 2023
1 parent 979e9ca commit b83cfda
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions android/capacitor/src/main/java/com/getcapacitor/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,12 @@ public void requestPermissions(PluginCall call) {
JSArray providedPerms = call.getArray("permissions");
List<String> providedPermsList = null;

try {
providedPermsList = providedPerms.toList();
} catch (JSONException ignore) {
// do nothing
if (providedPerms != null) {
try {
providedPermsList = providedPerms.toList();
} catch (JSONException ignore) {
// do nothing
}
}

// If call was made without any custom permissions, request all from plugin annotation
Expand Down

0 comments on commit b83cfda

Please sign in to comment.