CB-6936: Merge pull request #304 from uareurapid/master

CB-6936: fix crash when calling methods on a destroyed webview
This commit is contained in:
Joe Bowser 2017-09-15 13:26:21 -07:00 committed by GitHub
commit dddb2837dd

View File

@ -110,7 +110,11 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode(new NativeToJsMessageQueue.OnlineEventsBridgeMode.OnlineEventsBridgeModeDelegate() {
@Override
public void setNetworkAvailable(boolean value) {
webView.setNetworkAvailable(value);
//sometimes this can be called after calling webview.destroy() on destroy()
//thus resulting in a NullPointerException
if(webView!=null) {
webView.setNetworkAvailable(value);
}
}
@Override
public void runOnUiThread(Runnable r) {