Fix possible npe

This commit is contained in:
Chumva 2018-10-23 12:46:06 +03:00
parent 37f5dd5c0f
commit 19464a2a44

View file

@ -198,7 +198,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
} else if (resId == R.string.context_menu_item_modify_note) { } else if (resId == R.string.context_menu_item_modify_note) {
modifyOsmNote(mapActivity, (OsmNotesPoint) selectedObj); modifyOsmNote(mapActivity, (OsmNotesPoint) selectedObj);
} else if (resId == R.string.poi_context_menu_modify) { } else if (resId == R.string.poi_context_menu_modify) {
if (selectedObj instanceof TransportStop) { if (selectedObj instanceof TransportStop && ((TransportStop) selectedObj).getAmenity() != null) {
EditPoiDialogFragment.showEditInstance(((TransportStop) selectedObj).getAmenity(), mapActivity); EditPoiDialogFragment.showEditInstance(((TransportStop) selectedObj).getAmenity(), mapActivity);
} else if (selectedObj instanceof MapObject) { } else if (selectedObj instanceof MapObject) {
EditPoiDialogFragment.showEditInstance((MapObject) selectedObj, mapActivity); EditPoiDialogFragment.showEditInstance((MapObject) selectedObj, mapActivity);