From ef5ed3c17f6a511053d4ea9efa30684381150712 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 13 Oct 2014 08:37:00 -0500 Subject: [PATCH] Fix error caused by missing lane tags. When there is both a slight left turn and a slight right turn possible at a point, and neither of the outbound roads have a lanes tag, then an ArrayIndexOutOfBoundsException is thrown. --- .../src/net/osmand/router/RouteResultPreparation.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 9164a754d6..53fc467265 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -518,7 +518,9 @@ public class RouteResultPreparation { if(attached.getObject().getOneway() == 0) { lns = countLanes(attached, lns); } - if (lns > 0) { + if (lns <= 0) { + right += 1; + } else { right += lns; } speak = speak || rsSpeakPriority <= speakPriority; @@ -528,7 +530,9 @@ public class RouteResultPreparation { if(attached.getObject().getOneway() == 0) { lns = countLanes(attached, lns); } - if (lns > 0) { + if (lns <= 0) { + left += 1; + } else { left += lns; } speak = speak || rsSpeakPriority <= speakPriority;