Fixed NPE.

This commit is contained in:
GaidamakUA 2016-04-28 18:19:53 +03:00
parent f64b174b27
commit 4d52d027e0
2 changed files with 6 additions and 2 deletions

View file

@ -220,7 +220,7 @@ public class ConfigureMapMenu {
selected = settings.SELECTED_POI_FILTER_FOR_MAP.get() != null;
adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.layer_poi, activity)
.setSelected(settings.SELECTED_POI_FILTER_FOR_MAP.get() != null)
.setSelected(selected)
.setDescription(POIMapLayer.getSelectedPoiName(app))
.setColor(selected ? R.color.osmand_orange : ContextMenuItem.INVALID_ID)
.setIcon(R.drawable.ic_action_info_dark)

View file

@ -322,7 +322,11 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
return app.getResources().getString(R.string.shared_string_none);
}
PoiUIFilter filter = pfh.getFilterById(filterId);
return filter.getName();
if (filter == null) {
return app.getResources().getString(R.string.shared_string_none);
} else {
return filter.getName();
}
}
static int getResIdFromAttribute(final Context ctx, final int attr) {