Fix index out of bounds exceptions
This commit is contained in:
parent
1e2e23c059
commit
ad47ca4483
2 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue