From c73f5f8220cb9f9dd51af75f789797a1386d8d99 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 8 Jul 2019 11:40:48 +0200 Subject: [PATCH] Fix sorting undefined --- .../main/java/net/osmand/router/RouteStatisticsHelper.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java index 9b25daaa1e..f55647bec9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java @@ -269,6 +269,12 @@ public class RouteStatisticsHelper { @Override public int compare(String o1, String o2) { + if (o1.equalsIgnoreCase(UNDEFINED_ATTR)) { + return 1; + } + if (o2.equalsIgnoreCase(UNDEFINED_ATTR)) { + return -1; + } return -Float.compare(partition.get(o1).getDistance(), partition.get(o2).getDistance()); } });