diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt index ba1b54a29..335dd3b87 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt @@ -115,14 +115,14 @@ class WebViewActivity : BaseActivity() { } override fun onPrepareOptionsMenu(menu: Menu?): Boolean { - val backItem = binding.toolbar.menu.findItem(R.id.action_web_back) - val forwardItem = binding.toolbar.menu.findItem(R.id.action_web_forward) + val backItem = menu?.findItem(R.id.action_web_back) + val forwardItem = menu?.findItem(R.id.action_web_forward) backItem?.isEnabled = binding.webview.canGoBack() forwardItem?.isEnabled = binding.webview.canGoForward() val iconTintColor = getResourceColor(R.attr.colorOnPrimary) val translucentIconTintColor = ColorUtils.setAlphaComponent(iconTintColor, 127) - backItem.icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor) + backItem?.icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor) forwardItem?.icon?.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor) return super.onPrepareOptionsMenu(menu)