Fix NPE

Stephen Paul Weber created

Change summary

src/main/java/eu/siacs/conversations/entities/Contact.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/entities/Contact.java 🔗

@@ -526,8 +526,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() {