Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
🐛 fix call.getBoolean bugs and NullPointerExpections
Browse files Browse the repository at this point in the history
  • Loading branch information
tafelnl committed Jun 30, 2021
1 parent 874466c commit fc9ce35
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,12 @@ public void startScan(PluginCall call) {

@PluginMethod
public void stopScan(PluginCall call) {
if (call.hasOption("resolveScan") && call.getBool("resolveScan") && getSavedCall() != null) {
JSObject jsObject = new JSObject();
jsObject.put("hasContent", false);
if (call.hasOption("resolveScan") && getSavedCall() != null) {
Boolean resolveScan = call.getBoolean("resolveScan", false);
if (resolveScan != null && resolveScan) {
JSObject jsObject = new JSObject();
jsObject.put("hasContent", false);

if (getSavedCall() != null) {
getSavedCall().resolve(jsObject);
}
}
Expand Down Expand Up @@ -466,7 +467,10 @@ private void cameraPermsCallback(PluginCall call) {
public void checkPermission(PluginCall call) {
Boolean force = call.getBoolean("force", false);

_checkPermission(call, force);
if (force != null && force) {
_checkPermission(call, true);
}
_checkPermission(call, false);
}

@PluginMethod
Expand Down

0 comments on commit fc9ce35

Please sign in to comment.