Fixed NPE in localIndexFragment
This commit is contained in:
parent
018cf397b8
commit
51779e0c3a
1 changed files with 4 additions and 2 deletions
|
@ -478,9 +478,11 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
if (!this.isAdded()) {
|
||||
return;
|
||||
}
|
||||
//fixes issue when local files not shown after switching tabs
|
||||
//Next line throws NPE in some circumstances when called from dashboard and listAdpater=null is not checked
|
||||
if (listAdapter != null && listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) {
|
||||
if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) {
|
||||
for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) {
|
||||
listAdapter.addLocalIndexInfo(info);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue