diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java index 594f8d7723..2c3018cd49 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java @@ -55,6 +55,9 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL @Override public void onItemClick(View view) { int pos = recyclerView.getChildAdapterPosition(view); + if (pos == RecyclerView.NO_POSITION) { + return; + } MapMarker marker = adapter.getItem(pos); mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(), 15, marker.getPointDescription(mapActivity), true, marker); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index 3013dabc8b..8368cb8091 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -184,6 +184,9 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel @Override public void onItemClick(View view) { int pos = recyclerView.getChildAdapterPosition(view); + if (pos == RecyclerView.NO_POSITION) { + return; + } Object item = adapter.getItem(pos); if (item instanceof MapMarker) { MapMarker marker = (MapMarker) item;