From e4755d623da9d6e25e0c6793fa83b9e83c4cb1b4 Mon Sep 17 00:00:00 2001 From: Robb <35880555+robbwatershed@users.noreply.github.com> Date: Sun, 11 Jun 2023 11:30:51 +0200 Subject: [PATCH] Fix crash --- .../hentoid/activities/sources/BaseWebActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/devsaki/hentoid/activities/sources/BaseWebActivity.java b/app/src/main/java/me/devsaki/hentoid/activities/sources/BaseWebActivity.java index 86b68b000..aec8f2f4e 100644 --- a/app/src/main/java/me/devsaki/hentoid/activities/sources/BaseWebActivity.java +++ b/app/src/main/java/me/devsaki/hentoid/activities/sources/BaseWebActivity.java @@ -650,9 +650,11 @@ public void onGalleryPageStarted() { // Greys out the action button // useful for sites with JS loading that do not trigger onPageStarted (e.g. Luscious, Pixiv) runOnUiThread(() -> { - binding.actionButton.setImageDrawable(ContextCompat.getDrawable(this, downloadIcon)); - binding.actionButton.setVisibility(View.INVISIBLE); - binding.actionBtnBadge.setVisibility(View.INVISIBLE); + if (binding != null) { + binding.actionButton.setImageDrawable(ContextCompat.getDrawable(this, downloadIcon)); + binding.actionButton.setVisibility(View.INVISIBLE); + binding.actionBtnBadge.setVisibility(View.INVISIBLE); + } }); }