mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-21 08:12:56 +08:00
fix crash when calling methods on a destroyed webview
This commit is contained in:
parent
d351e316bf
commit
bcf3f8611a
@ -109,7 +109,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user