Merge pull request #5338 from osmandapp/PaulsBranch

Fixed indexOutOfBounds for short description
This commit is contained in:
Alexander Sytnyk 2018-05-03 15:44:29 +03:00 committed by GitHub
commit d435609a0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,8 @@ public class TravelArticle {
int firstParagraphStart = content.indexOf(pOpened);
int firstParagraphEnd = content.indexOf(pClosed);
if (firstParagraphStart == -1 || firstParagraphEnd == -1) {
if (firstParagraphStart == -1 || firstParagraphEnd == -1
|| firstParagraphEnd < firstParagraphStart) {
return null;
}
int pClosedLength = pClosed.length();