fixed npe for otr sessions with non contacts

This commit is contained in:
Daniel Gultsch 2014-05-16 22:44:54 +02:00
parent 225447f2f5
commit a0a5ca9585
1 changed files with 8 additions and 4 deletions

View File

@ -269,6 +269,9 @@ public class Conversation extends AbstractEntity {
return false; return false;
} else { } else {
String foreignPresence = this.otrSession.getSessionID().getUserID(); String foreignPresence = this.otrSession.getSessionID().getUserID();
if (getContact()==null) {
return true;
} else {
if (!getContact().getPresences().containsKey(foreignPresence)) { if (!getContact().getPresences().containsKey(foreignPresence)) {
this.resetOtrSession(); this.resetOtrSession();
return false; return false;
@ -276,6 +279,7 @@ public class Conversation extends AbstractEntity {
return true; return true;
} }
} }
}
public String getOtrFingerprint() { public String getOtrFingerprint() {
if (this.otrFingerprint == null) { if (this.otrFingerprint == null) {