Przeglądaj źródła

Avoid rare crash in WebViewActivity

arkon 4 lat temu
rodzic
commit
27cec697bf

+ 3 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt

@@ -139,8 +139,10 @@ class WebViewActivity : BaseViewBindingActivity<WebviewActivityBinding>() {
     }
 
     override fun onDestroy() {
-        binding.webview?.destroy()
         super.onDestroy()
+
+        // Binding sometimes isn't actually instantiated yet somehow
+        binding?.webview?.destroy()
     }
 
     override fun onCreateOptionsMenu(menu: Menu): Boolean {