Skip to content

Commit

Permalink
Android: Avoid throwing error when initManager is called twice
Browse files Browse the repository at this point in the history
Made changes to prevent IllegalStateException from being thrown when initManager is called more than once. Rather than throwing an error, the code now logs a message and simply returns without further action.
  • Loading branch information
nvahalik committed Jul 18, 2024
1 parent c43ea96 commit 6f49801
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/android/FileTransferBackground.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ public boolean execute(String action, JSONArray args, final CallbackContext call
}

private void initManager(String options, final CallbackContext callbackContext) throws IllegalStateException {
// Calling this twice isn't a huge deal. Let's not make it one.
if (this.ready) {
throw new IllegalStateException("initManager was called twice");
logMessage("initManager was called after it was already initialized");
return;
}

try {
Expand Down

0 comments on commit 6f49801

Please sign in to comment.