diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index e26f9de7f8..33553bc779 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -428,7 +428,10 @@ public class BinaryMapIndexReader { if (ls.endsWith("_2")) { ls = ls.substring(0, ls.length() - "_2".length()); } - return ls.substring(0, ls.lastIndexOf('_')).replace('_', ' '); + if (ls.lastIndexOf('_') != -1) { + ls = ls.substring(0, ls.lastIndexOf('_')).replace('_', ' '); + } + return ls; } }