This commit is contained in:
Alexander Sytnyk 2017-07-31 10:45:27 +03:00
parent 7576fbc7ca
commit 377456b909

View file

@ -578,14 +578,19 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
private void putAllAcceptedTypes(Map<PoiCategory, LinkedHashSet<String>> types) { private void putAllAcceptedTypes(Map<PoiCategory, LinkedHashSet<String>> types) {
for (PoiCategory category : types.keySet()) { for (PoiCategory category : types.keySet()) {
LinkedHashSet<String> typesSet = types.get(category);
if (acceptedTypes.containsKey(category)) { if (acceptedTypes.containsKey(category)) {
if (acceptedTypes.get(category) != null && types.get(category) != null) { if (acceptedTypes.get(category) != null && typesSet != null) {
acceptedTypes.get(category).addAll(types.get(category)); acceptedTypes.get(category).addAll(typesSet);
} else { } else {
acceptedTypes.put(category, null); acceptedTypes.put(category, null);
} }
} else { } else {
acceptedTypes.put(category, new LinkedHashSet<>(types.get(category))); if (typesSet != null) {
acceptedTypes.put(category, new LinkedHashSet<>(typesSet));
} else {
acceptedTypes.put(category, null);
}
} }
} }
} }