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;
|
selected = settings.SELECTED_POI_FILTER_FOR_MAP.get() != null;
|
||||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||||
.setTitleId(R.string.layer_poi, activity)
|
.setTitleId(R.string.layer_poi, activity)
|
||||||
.setSelected(settings.SELECTED_POI_FILTER_FOR_MAP.get() != null)
|
.setSelected(selected)
|
||||||
.setDescription(POIMapLayer.getSelectedPoiName(app))
|
.setDescription(POIMapLayer.getSelectedPoiName(app))
|
||||||
.setColor(selected ? R.color.osmand_orange : ContextMenuItem.INVALID_ID)
|
.setColor(selected ? R.color.osmand_orange : ContextMenuItem.INVALID_ID)
|
||||||
.setIcon(R.drawable.ic_action_info_dark)
|
.setIcon(R.drawable.ic_action_info_dark)
|
||||||
|
|
|
@ -322,8 +322,12 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
return app.getResources().getString(R.string.shared_string_none);
|
return app.getResources().getString(R.string.shared_string_none);
|
||||||
}
|
}
|
||||||
PoiUIFilter filter = pfh.getFilterById(filterId);
|
PoiUIFilter filter = pfh.getFilterById(filterId);
|
||||||
|
if (filter == null) {
|
||||||
|
return app.getResources().getString(R.string.shared_string_none);
|
||||||
|
} else {
|
||||||
return filter.getName();
|
return filter.getName();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int getResIdFromAttribute(final Context ctx, final int attr) {
|
static int getResIdFromAttribute(final Context ctx, final int attr) {
|
||||||
if (attr == 0)
|
if (attr == 0)
|
||||||
|
|
Loading…
Reference in a new issue