Fixed NPE in UpdatesIntexFragment
This commit is contained in:
parent
1041b2de05
commit
260d4eede2
1 changed files with 6 additions and 1 deletions
|
@ -41,7 +41,12 @@ public class UpdatesIndexFragment extends SherlockListFragment {
|
||||||
format = getMyApplication().getResourceManager().getDateFormat();
|
format = getMyApplication().getResourceManager().getDateFormat();
|
||||||
updateColor = getResources().getColor(R.color.color_update);
|
updateColor = getResources().getColor(R.color.color_update);
|
||||||
osmandRegions = getMyApplication().getResourceManager().getOsmandRegions();
|
osmandRegions = getMyApplication().getResourceManager().getOsmandRegions();
|
||||||
listAdapter = new UpdateIndexAdapter(getDownloadActivity(), R.layout.download_index_list_item, DownloadActivity.downloadListIndexThread.getItemsToUpdate());
|
List<IndexItem> indexItems = new ArrayList<IndexItem>();
|
||||||
|
if (DownloadActivity.downloadListIndexThread != null &&
|
||||||
|
DownloadActivity.downloadListIndexThread.getItemsToUpdate() != null) {
|
||||||
|
indexItems = DownloadActivity.downloadListIndexThread.getItemsToUpdate();
|
||||||
|
}
|
||||||
|
listAdapter = new UpdateIndexAdapter(getDownloadActivity(), R.layout.download_index_list_item, indexItems);
|
||||||
listAdapter.sort(new Comparator<IndexItem>() {
|
listAdapter.sort(new Comparator<IndexItem>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(IndexItem indexItem, IndexItem indexItem2) {
|
public int compare(IndexItem indexItem, IndexItem indexItem2) {
|
||||||
|
|
Loading…
Reference in a new issue