From 4a52e4fcd567db4327daed6a398c8bafd2ba95a1 Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 16 Feb 2018 14:34:25 +0200 Subject: [PATCH] fixed small bug(if localTransportStopRoutes==null .size will throw exception) --- .../osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 80d7d4ebba..d4e6cea400 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -498,13 +498,13 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo List localTransportStopRoutes = menu.getMenuController().getLocalTransportStopRoutes(); List nearbyTransportStopRoutes = menu.getMenuController().getNearbyTransportStopRoutes(); - if (localTransportStopRoutes.size() > 0) { + if (localTransportStopRoutes!=null&&localTransportStopRoutes.size() > 0) { localTransportStopRoutesGrid.setAdapter(createTransportStopRouteAdapter(localTransportStopRoutes)); localTransportStopRoutesGrid.setVisibility(View.VISIBLE); } else { localTransportStopRoutesGrid.setVisibility(View.GONE); } - if (nearbyTransportStopRoutes.size() > 0) { + if (nearbyTransportStopRoutes!=null&&nearbyTransportStopRoutes.size() > 0) { String nearInDistance = getMyApplication().getString(R.string.transport_nearby_routes) + " " + OsmAndFormatter.getFormattedDistance(150, getMyApplication()); nearbRoutesWithinTv.setText(nearInDistance);