diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuBuilder.java b/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuBuilder.java index 8c274c9497..855492be92 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/menu/WikivoyageWptPtMenuBuilder.java @@ -76,20 +76,22 @@ public class WikivoyageWptPtMenuBuilder extends WptPtMenuBuilder { } private HashMap getDescriptionTokens(String desc, String... allowedKeys) { - String[] tokens = desc.split("\n"); HashMap mTokens = new HashMap<>(); - for (String token : tokens) { - boolean matched = false; - for (String key : allowedKeys) { - if (token.startsWith(key)) { - matched = true; - String value = token.substring(key.length()).trim(); - mTokens.put(key, value); + if (!Algorithms.isEmpty(desc)) { + String[] tokens = desc.split("\n"); + for (String token : tokens) { + boolean matched = false; + for (String key : allowedKeys) { + if (token.startsWith(key)) { + matched = true; + String value = token.substring(key.length()).trim(); + mTokens.put(key, value); + } + } + if (!matched) { + String s = mTokens.get(KEY_DESCRIPTION); + mTokens.put(KEY_DESCRIPTION, s != null ? s + "\n" + token : token); } - } - if (!matched) { - String s = mTokens.get(KEY_DESCRIPTION); - mTokens.put(KEY_DESCRIPTION, s != null ? s + "\n" + token : token); } } return mTokens;