Android: add try catch around dialog.dismiss() to prevent crashes
This commit is contained in:
parent
1e8599a32a
commit
4a3b2ef641
@ -533,7 +533,11 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
// NB: wait for about:blank before dismissing
|
// NB: wait for about:blank before dismissing
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
if (dialog != null && !cordova.getActivity().isFinishing()) {
|
if (dialog != null && !cordova.getActivity().isFinishing()) {
|
||||||
dialog.dismiss();
|
try {
|
||||||
|
dialog.dismiss();
|
||||||
|
} catch(IllegalArgumentException e) {
|
||||||
|
LOG.e(LOG_TAG, "Caught exception when trying to close IAB dialog: " + e);
|
||||||
|
}
|
||||||
dialog = null;
|
dialog = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user