From 50bdc0083d7079a8193040cc2da312fc430b0354 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 15 Mar 2019 14:02:24 +0100 Subject: [PATCH] Fix empty routes --- .../src/main/java/net/osmand/router/TransportRoutePlanner.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 7b05fb6865..27a3e6e1c6 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -38,6 +38,9 @@ public class TransportRoutePlanner { for(TransportRouteSegment s : endStops) { endSegments.put(s.getId(), s); } + if(startStops.size() == 0) { + return Collections.emptyList(); + } PriorityQueue queue = new PriorityQueue(startStops.size(), new SegmentsComparator(ctx)); for(TransportRouteSegment r : startStops){ r.walkDist = (float) MapUtils.getDistance(r.getLocation(), start);