Fixed NPE.
This commit is contained in:
parent
f64b174b27
commit
4d52d027e0
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue