Fixed newly introduced bug.

This commit is contained in:
GaidamakUA 2016-05-31 15:59:44 +03:00
parent 7c63cd893d
commit 0a4d651cd3

View file

@ -333,14 +333,15 @@ public class ContextMenuLayer extends OsmandMapLayer {
Object selectedObj = selectedObjects.keySet().iterator().next(); Object selectedObj = selectedObjects.keySet().iterator().next();
LatLon latLon = null; LatLon latLon = null;
PointDescription pointDescription = null; PointDescription pointDescription = null;
if (selectedObjectContextMenuProvider != null) { final IContextMenuProvider provider = selectedObjects.get(selectedObj);
latLon = selectedObjectContextMenuProvider.getObjectLocation(selectedObj); if (provider != null) {
pointDescription = selectedObjectContextMenuProvider.getObjectName(selectedObj); latLon = provider.getObjectLocation(selectedObj);
pointDescription = provider.getObjectName(selectedObj);
} }
if (latLon == null) { if (latLon == null) {
latLon = getLatLon(point, tileBox); latLon = getLatLon(point, tileBox);
} }
showContextMenu(latLon, pointDescription, selectedObj, selectedObjects.get(selectedObj)); showContextMenu(latLon, pointDescription, selectedObj, provider);
return true; return true;
} else if (selectedObjects.size() > 1) { } else if (selectedObjects.size() > 1) {