From f3a3823e3769572114aa1750db4c65041fe0cf71 Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 19 Dec 2014 19:28:12 +0100 Subject: [PATCH] separate if conditions to identify NPE --- .../src/net/osmand/plus/download/LocalIndexesFragment.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 408ed86218..56389438bb 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -479,13 +479,16 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { //fixes issue when local files not shown after switching tabs - if (listAdapter.getGroupCount() == 0 && - getDownloadActivity().getLocalIndexInfos().size() > 0){ + //temporarily separate this if statement to identify NPE on soma installations + //if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0){ + if (listAdapter.getGroupCount() == 0){ + if (getDownloadActivity().getLocalIndexInfos().size() > 0){ for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()){ listAdapter.addLocalIndexInfo(info); } listAdapter.sortData(); getExpandableListView().setAdapter(listAdapter); + } } ActionBar actionBar = getDownloadActivity().getSupportActionBar(); //hide action bar from downloadindexfragment