diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java index 161d6d2a8..e6b13dcd1 100644 --- a/src/main/java/eu/siacs/conversations/entities/Contact.java +++ b/src/main/java/eu/siacs/conversations/entities/Contact.java @@ -568,8 +568,8 @@ public class Contact implements ListItem, Blockable { return getJid().compareTo(another.getJid()); } - return this.getDisplayName().compareToIgnoreCase( - another.getDisplayName()); + final var anotherName = another.getDisplayName(); + return this.getDisplayName().compareToIgnoreCase(anotherName == null ? "" : anotherName); } public String getServer() {