Prevent NPE
This commit is contained in:
parent
f34b673ac5
commit
7f29627ac7
|
@ -100,6 +100,7 @@ public class ItemlistFragment extends ListFragment {
|
||||||
|
|
||||||
private boolean itemsLoaded = false;
|
private boolean itemsLoaded = false;
|
||||||
private boolean viewsCreated = false;
|
private boolean viewsCreated = false;
|
||||||
|
private boolean headerCreated = false;
|
||||||
|
|
||||||
private List<Downloader> downloaderList;
|
private List<Downloader> downloaderList;
|
||||||
|
|
||||||
|
@ -466,8 +467,8 @@ public class ItemlistFragment extends ListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshHeaderView() {
|
private void refreshHeaderView() {
|
||||||
if (getListView() == null || feed == null) {
|
if (getListView() == null || feed == null || !headerCreated) {
|
||||||
Log.e(TAG, "Unable to setup listview: recyclerView = null or feed = null");
|
Log.e(TAG, "Unable to refresh header view");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(feed.hasLastUpdateFailed()) {
|
if(feed.hasLastUpdateFailed()) {
|
||||||
|
@ -546,6 +547,7 @@ public class ItemlistFragment extends ListFragment {
|
||||||
startActivity(startIntent);
|
startActivity(startIntent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
headerCreated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue