8000 Fix bug where WebView.destroy crash the app with API <= 18. just set … · roychowdhuryrohit-dev/Android@15ff173 · GitHub
[go: up one dir, main page]

Skip to content

Commit 15ff173

Browse files
committed
Fix bug where WebView.destroy crash the app with API <= 18. just set the WebView to null in those cases
1 parent f944c9a commit 15ff173

File tree

1 file changed

+5
-1
lines changed
  • app/src/main/java/com/duckduckgo/mobile/android/duckduckgo/ui/browser

1 file changed

+5
-1
lines changed

app/src/main/java/com/duckduckgo/mobile/android/duckduckgo/ui/browser/Browser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ private void pauseWebView(WebView webView) {
171171
private void destroyWebView(WebView webView) {
172172
if (webView == null) return;
173173
webView.stopLoading();
174-
webView.destroy();
174+
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
175+
webView.destroy();
176+
} else {
177+
webView = null;
178+
}
175179
}
176180

177181
@SuppressLint("SetJavaScriptEnabled")

0 commit comments

Comments
 (0)
0