From a0a5ca958596e47e273b04f0608acf23825abf7e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 16 May 2014 22:44:54 +0200 Subject: [PATCH] fixed npe for otr sessions with non contacts --- .../siacs/conversations/entities/Conversation.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java index 20c70d29d..88d6279e9 100644 --- a/src/eu/siacs/conversations/entities/Conversation.java +++ b/src/eu/siacs/conversations/entities/Conversation.java @@ -269,11 +269,15 @@ public class Conversation extends AbstractEntity { return false; } else { String foreignPresence = this.otrSession.getSessionID().getUserID(); - if (!getContact().getPresences().containsKey(foreignPresence)) { - this.resetOtrSession(); - return false; + if (getContact()==null) { + return true; + } else { + if (!getContact().getPresences().containsKey(foreignPresence)) { + this.resetOtrSession(); + return false; + } + return true; } - return true; } }