瀏覽代碼

Avoid rare crash in WebViewActivity

arkon 4 年之前
父節點
當前提交
27cec697bf
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt

+ 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 {