Fix possible npe

(cherry picked from commit 19464a2)
This commit is contained in:
Chumva 2018-10-23 12:46:06 +03:00
parent a5018b9b98
commit 9c2a51fb4b

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);