From: Soren Stoutner Date: Sat, 10 Dec 2022 19:10:59 +0000 (-0700) Subject: Fix a rare crash when the system back button is selected. https://redmine.stoutner... X-Git-Tag: v3.13~10 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=58dbf864ccd5dd341517e1ff0adaf681476d4a4f;p=PrivacyBrowserAndroid.git Fix a rare crash when the system back button is selected. https://redmine.stoutner.com/issues/944 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 461c7405..637e9a52 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -638,7 +638,8 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } else if (displayingFullScreenVideo) { // A full screen video is shown. // Exit the full screen video. exitFullScreenVideo(); - } else if (currentWebView.canGoBack()) { // There is at least one item in the current WebView history. + // It shouldn't be possible for the currentWebView to be null, but crash logs indicate it sometimes happens. + } else if ((currentWebView != null) && (currentWebView.canGoBack())) { // There is at least one item in the current WebView history. // Get the current web back forward list. WebBackForwardList webBackForwardList = currentWebView.copyBackForwardList();