1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00

Merge pull request #625 from coffeemakr/fix-nullpointer-in-background-handler

Check if view still exists in UICallback
This commit is contained in:
Mauricio Colli 2017-07-12 08:46:20 -03:00 committed by GitHub
commit d210b600d7

View File

@ -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;