Fix possible npe
This commit is contained in:
parent
c4aafe20cb
commit
e35c7f5ead
1 changed files with 14 additions and 12 deletions
|
@ -76,8 +76,9 @@ public class WikivoyageWptPtMenuBuilder extends WptPtMenuBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private HashMap<String, String> getDescriptionTokens(String desc, String... allowedKeys) {
|
private HashMap<String, String> getDescriptionTokens(String desc, String... allowedKeys) {
|
||||||
String[] tokens = desc.split("\n");
|
|
||||||
HashMap<String, String> mTokens = new HashMap<>();
|
HashMap<String, String> mTokens = new HashMap<>();
|
||||||
|
if (!Algorithms.isEmpty(desc)) {
|
||||||
|
String[] tokens = desc.split("\n");
|
||||||
for (String token : tokens) {
|
for (String token : tokens) {
|
||||||
boolean matched = false;
|
boolean matched = false;
|
||||||
for (String key : allowedKeys) {
|
for (String key : allowedKeys) {
|
||||||
|
@ -92,6 +93,7 @@ public class WikivoyageWptPtMenuBuilder extends WptPtMenuBuilder {
|
||||||
mTokens.put(KEY_DESCRIPTION, s != null ? s + "\n" + token : token);
|
mTokens.put(KEY_DESCRIPTION, s != null ? s + "\n" + token : token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return mTokens;
|
return mTokens;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue