1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01:00

add null check

add checks for null. This happens after rotating the screen while is turned off
This commit is contained in:
kapodamy 2019-01-24 23:23:30 -03:00 committed by GitHub
parent 338893ded4
commit 21eb98a52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ public class MissionAdapter extends Adapter<ViewHolder> {
str = R.string.missions_header_pending;
} else {
str = R.string.missions_header_finished;
mClear.setVisible(true);
if (mClear != null) mClear.setVisible(true);
}
((ViewHolderHeader) view).header.setText(str);
@ -437,7 +437,6 @@ public class MissionAdapter extends Adapter<ViewHolder> {
public void clearFinishedDownloads() {
mDownloadManager.forgetFinishedDownloads();
applyChanges();
mClear.setVisible(false);
}
private boolean handlePopupItem(@NonNull ViewHolderItem h, @NonNull MenuItem option) {
@ -507,7 +506,7 @@ public class MissionAdapter extends Adapter<ViewHolder> {
mIterator.end();
checkEmptyMessageVisibility();
mClear.setVisible(mIterator.hasFinishedMissions());
if (mClear != null) mClear.setVisible(mIterator.hasFinishedMissions());
}
public void forceUpdate() {