diff --git a/key.core/src/main/java/de/uka/ilkd/key/parser/Location.java b/key.core/src/main/java/de/uka/ilkd/key/parser/Location.java index 46b4b813bbf..4a82961a52f 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/parser/Location.java +++ b/key.core/src/main/java/de/uka/ilkd/key/parser/Location.java @@ -94,8 +94,7 @@ public int hashCode() { @Override public int compareTo(@NonNull Location o) { - return Comparator - .comparing(l -> l.fileUri) - .thenComparing(Location::getPosition).compare(this, o); + return Comparator.comparing(l -> l.fileUri, Comparator.nullsLast(Comparator.naturalOrder())) + .thenComparing(Location::getPosition, Comparator.nullsLast(Comparator.naturalOrder())).compare(this, o); } }