Merge pull request #8946 from osmandapp/minor_fixes
Fix possible StringIndexOutOfBoundsException
This commit is contained in:
commit
183bcb7b03
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue