diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index d103ff5776..b4b090442d 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -1205,9 +1205,11 @@ public class RouteCalculationResult { int dist = listDistance[rp]; Location l = locations.get(rp); if(ap != null){ - dist += fromLoc.distanceTo(ap); + if (fromLoc != null) { + dist += fromLoc.distanceTo(ap); + } dist += ap.distanceTo(l); - } else { + } else if (fromLoc != null) { dist += fromLoc.distanceTo(l); } return dist;