Fix crash from RYD when video is being fullscreened

This commit is contained in:
blankie 2023-02-12 16:00:03 +07:00
parent 5d222fce16
commit b26df18183
No known key found for this signature in database
GPG key ID: CC15FC822C7F61F5

View file

@ -1547,11 +1547,18 @@ public final class VideoDetailFragment
new Thread(() -> { new Thread(() -> {
info.setDislikeCount(ReturnYouTubeDislikeUtils.getDislikes(getContext(), info)); info.setDislikeCount(ReturnYouTubeDislikeUtils.getDislikes(getContext(), info));
if (info.getDislikeCount() >= 0) { if (info.getDislikeCount() >= 0) {
if (activity == null) {
return;
}
activity.runOnUiThread(() -> { activity.runOnUiThread(() -> {
if (binding != null && binding.detailThumbsDownCountView != null) {
binding.detailThumbsDownCountView.setText(Localization binding.detailThumbsDownCountView.setText(Localization
.shortCount(activity, info.getDislikeCount())); .shortCount(activity, info.getDislikeCount()));
binding.detailThumbsDownCountView.setVisibility(View.VISIBLE); binding.detailThumbsDownCountView.setVisibility(View.VISIBLE);
}
if (binding != null && binding.detailThumbsDownImgView != null) {
binding.detailThumbsDownImgView.setVisibility(View.VISIBLE); binding.detailThumbsDownImgView.setVisibility(View.VISIBLE);
}
}); });
} }
}).start(); }).start();