From 039e2126665498c639fffc3b0d45e889299e226d Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Mon, 6 Nov 2017 13:40:21 +0200 Subject: [PATCH] Fix crash --- OsmAnd-java/src/net/osmand/util/MapUtils.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/util/MapUtils.java b/OsmAnd-java/src/net/osmand/util/MapUtils.java index 9c5363de55..829a9cf13a 100644 --- a/OsmAnd-java/src/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/net/osmand/util/MapUtils.java @@ -835,14 +835,16 @@ public class MapUtils { } } else { if (digit){ - try { - double dl = Double.parseDouble(s.substring(word, i)); - d.add(dl); - all.add(dl); - strings.add(s.substring(word, i)); - digit = false; - word = -1; - } catch (NumberFormatException e) { + if (word != -1) { + try { + double dl = Double.parseDouble(s.substring(word, i)); + d.add(dl); + all.add(dl); + strings.add(s.substring(word, i)); + digit = false; + word = -1; + } catch (NumberFormatException e) { + } } } if (nonwh) {