Android: add try catch around dialog.dismiss() to prevent crashes

This commit is contained in:
Juergen 2023-09-05 15:23:08 +02:00
parent 1e8599a32a
commit 4a3b2ef641

View File

@ -533,7 +533,11 @@ public class InAppBrowser extends CordovaPlugin {
// NB: wait for about:blank before dismissing
public void onPageFinished(WebView view, String url) {
if (dialog != null && !cordova.getActivity().isFinishing()) {
try {
dialog.dismiss();
} catch(IllegalArgumentException e) {
LOG.e(LOG_TAG, "Caught exception when trying to close IAB dialog: " + e);
}
dialog = null;
}
}