From 70da5769d4ff2a4f01a7e0b7747e8589599889a2 Mon Sep 17 00:00:00 2001 From: Coffeemakr Date: Wed, 12 Jul 2017 09:47:09 +0200 Subject: [PATCH] Check if view still exists in UICallback --- .../fragments/detail/VideoDetailFragment.java | 12 ++++++++---- 1 file changed, 8 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 5588773ec..7b0db114c 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 @@ -1225,12 +1225,16 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor public boolean handleMessage(Message msg) { switch (msg.what) { case BackgroundCallback.MESSAGE_DESCRIPTION: - videoDescriptionView.setText((Spanned) msg.obj); - videoDescriptionView.setVisibility(View.VISIBLE); + if (videoDescriptionView != null) { + videoDescriptionView.setText((Spanned) msg.obj); + videoDescriptionView.setVisibility(View.VISIBLE); + } return true; case BackgroundCallback.MESSAGE_UPLOADER_DATE: - videoUploadDateView.setText((String) msg.obj); - videoUploadDateView.setVisibility(View.VISIBLE); + if (videoUploadDateView != null) { + videoUploadDateView.setText((String) msg.obj); + videoUploadDateView.setVisibility(View.VISIBLE); + } return true; } return false;