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..83b5e395817 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 @@ -95,7 +95,8 @@ public int hashCode() { @Override public int compareTo(@NonNull Location o) { return Comparator - .comparing(l -> l.fileUri) - .thenComparing(Location::getPosition).compare(this, o); + .comparing(l -> l.fileUri, Comparator.nullsLast(Comparator.naturalOrder())) + .thenComparing(Location::getPosition, Comparator.nullsLast(Comparator.naturalOrder())) + .compare(this, o); } }