From b26df1818336d055e3ad0d5a5f90f378af9d5d89 Mon Sep 17 00:00:00 2001 From: blankie Date: Sun, 12 Feb 2023 16:00:03 +0700 Subject: [PATCH] Fix crash from RYD when video is being fullscreened --- .../fragments/detail/VideoDetailFragment.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 1c365a649..aa0d43241 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -1547,11 +1547,18 @@ public final class VideoDetailFragment new Thread(() -> { info.setDislikeCount(ReturnYouTubeDislikeUtils.getDislikes(getContext(), info)); if (info.getDislikeCount() >= 0) { + if (activity == null) { + return; + } activity.runOnUiThread(() -> { - binding.detailThumbsDownCountView.setText(Localization - .shortCount(activity, info.getDislikeCount())); - binding.detailThumbsDownCountView.setVisibility(View.VISIBLE); - binding.detailThumbsDownImgView.setVisibility(View.VISIBLE); + if (binding != null && binding.detailThumbsDownCountView != null) { + binding.detailThumbsDownCountView.setText(Localization + .shortCount(activity, info.getDislikeCount())); + binding.detailThumbsDownCountView.setVisibility(View.VISIBLE); + } + if (binding != null && binding.detailThumbsDownImgView != null) { + binding.detailThumbsDownImgView.setVisibility(View.VISIBLE); + } }); } }).start();