Fixed NPE in UpdatesIntexFragment
This commit is contained in:
parent
cb6a9983fc
commit
eee6eddf6f
1 changed files with 6 additions and 1 deletions
|
@ -41,7 +41,12 @@ public class UpdatesIndexFragment extends SherlockListFragment {
|
|||
format = getMyApplication().getResourceManager().getDateFormat();
|
||||
updateColor = getResources().getColor(R.color.color_update);
|
||||
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>() {
|
||||
@Override
|
||||
public int compare(IndexItem indexItem, IndexItem indexItem2) {
|
||||
|
|
Loading…
Reference in a new issue