diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index 08c0e05efe..ac4aae0893 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -643,9 +643,8 @@ public class ContextMenuLayer extends OsmandMapLayer { } } for (Map.Entry entry : selectedObjects.entrySet()) { - Object o = entry.getKey(); IContextMenuProvider provider = entry.getValue(); - if (o != null && provider != null && provider.runExclusiveAction(o, showUnknownLocation)) { + if (provider != null && provider.runExclusiveAction(entry.getKey(), showUnknownLocation)) { return true; } } @@ -931,7 +930,7 @@ public class ContextMenuLayer extends OsmandMapLayer { boolean isObjectClickable(Object o); - boolean runExclusiveAction(Object o, boolean unknownLocation); + boolean runExclusiveAction(@Nullable Object o, boolean unknownLocation); } public interface IMoveObjectProvider { diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index 3de4f99215..93f80d5a35 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -483,7 +483,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi @Override public boolean runExclusiveAction(Object o, boolean unknownLocation) { - if (unknownLocation || !(o instanceof MapMarker) + if (unknownLocation || o == null || !(o instanceof MapMarker) || !map.getMyApplication().getSettings().SELECT_MARKER_ON_SINGLE_TAP.get()) { return false; }