Skip to content

Commit d8bdd32

Browse files
committed
fix(android): avoid to crash the app closing the InAppBrowser (apache#1018)
1 parent e2d8429 commit d8bdd32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/android/InAppBrowser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,11 @@ public void run() {
536536
// NB: wait for about:blank before dismissing
537537
public void onPageFinished(WebView view, String url) {
538538
if (dialog != null && !cordova.getActivity().isFinishing()) {
539-
dialog.dismiss();
539+
try {
540+
dialog.dismiss();
541+
} catch(IllegalArgumentException e) {
542+
LOG.e(LOG_TAG, "Caught exception when trying to close IAB dialog: " + e);
543+
}
540544
dialog = null;
541545
}
542546
}

0 commit comments

Comments
 (0)