From cbc55ede293ecdbb0e8e513268d0b8705722e65a Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 6 Feb 2020 13:34:16 +0200 Subject: [PATCH] fix --- .../java/net/osmand/router/RouteResultPreparation.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java index 49495b8c86..e19cb68c85 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -1739,10 +1739,12 @@ public class RouteResultPreparation { public void remove() { } }; - } else { - RouteSegment rt = ctx.loadRouteSegment(road.getPoint31XTile(pointInd), road.getPoint31YTile(pointInd), ctx.config.memoryLimitation, - recalculation); + } else if (recalculation) { + RouteSegment rt = ctx.loadRouteSegment(road.getPoint31XTile(pointInd), road.getPoint31YTile(pointInd), ctx.config.memoryLimitation); it = rt == null ? null : rt.getIterator(); + } else { + // Here we assume that all segments should be attached by native + it = null; } // try to attach all segments except with current id while (it != null && it.hasNext()) {