Skip to content

Commit bbf9f3c

Browse files
authored
Merge pull request #10 from hogangnono/feature/HGNN-7853
[HGNN-7853] handle IllegalArgumentException during closeDialog
2 parents 834fb57 + a379e88 commit bbf9f3c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/android/InAppBrowser.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,12 @@ public void run() {
556556
childView.setWebViewClient(new WebViewClient() {
557557
// NB: wait for about:blank before dismissing
558558
public void onPageFinished(WebView view, String url) {
559-
if (dialog != null && !cordova.getActivity().isFinishing()) {
560-
dialog.dismiss();
559+
if (dialog != null && dialog.isShowing() && !cordova.getActivity().isFinishing()) {
560+
try {
561+
dialog.dismiss();
562+
} catch(IllegalArgumentException e) {
563+
LOG.e(LOG_TAG, "Caught exception when trying to close IAB dialog: " + e);
564+
}
561565
dialog = null;
562566
}
563567
}

0 commit comments

Comments
 (0)