Fix crash with search navigation

This commit is contained in:
Victor Shcherb 2021-01-19 16:44:57 +01:00
parent 2efb0ac6af
commit d416ef0a6a
2 changed files with 9 additions and 14 deletions

View file

@ -182,10 +182,10 @@ public class Building extends MapObject {
@Override @Override
public String toString() { public String toString() {
if(interpolationInterval !=0){ if (interpolationInterval != 0) {
return name+"-"+name2 +" (+"+interpolationInterval+") "; return name + "-" + name2 + " (+" + interpolationInterval + ") ";
} else if(interpolationType != null) { } else if (interpolationType != null) {
return name+"-"+name2 +" ("+interpolationType+") "; return name + "-" + name2 + " (" + interpolationType + ") ";
} }
return name; return name;
} }

View file

@ -1004,17 +1004,12 @@ public class SearchUICore {
String subType2 = a2.getSubType() == null ? "" : a2.getSubType(); String subType2 = a2.getSubType() == null ? "" : a2.getSubType();
int cmp = 0; int cmp = 0;
boolean subtypeFilter1 = FILTER_DUPLICATE_POI_SUBTYPE.contains(subType1);
if (FILTER_DUPLICATE_POI_SUBTYPE.contains(subType1)) { boolean subtypeFilter2 = FILTER_DUPLICATE_POI_SUBTYPE.contains(subType2);
cmp = 1; if (subtypeFilter1 != subtypeFilter2) {
} else if (FILTER_DUPLICATE_POI_SUBTYPE.contains(subType2)) { // to filter second
cmp = -1; return subtypeFilter1 ? 1 : -1;
} }
if (cmp != 0) {
return cmp;
}
cmp = c.collator.compare(type1, type2); cmp = c.collator.compare(type1, type2);
if (cmp != 0) { if (cmp != 0) {
return cmp; return cmp;