From 5170e526c8026b3b22be4eb1929425947cc55786 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 18 Apr 2018 10:24:57 +0200 Subject: [PATCH] fixed npe when conversation in multi mode had jid w/o local part --- .../java/eu/siacs/conversations/entities/Conversation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index bc7afb8b9..ce051cbb5 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -484,7 +484,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } } - public CharSequence getName() { + public @NonNull CharSequence getName() { if (getMode() == MODE_MULTI) { final String subject = getMucOptions().getSubject(); final Bookmark bookmark = getBookmark(); @@ -498,7 +498,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl if (printableValue(generatedName)) { return generatedName; } else { - return getJid().getLocal(); + return contactJid.getLocal() != null ? contactJid.getLocal() : contactJid; } } } else if (isWithStranger()) {