diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-01 10:58:06 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-01 10:58:06 +0100 |
commit | 96bbd16ca52f4225d4badf6a02041a8a98f0f039 (patch) | |
tree | 1fa093074feb745f893a545d11eaf39edd1b93af /src/main/java/eu/siacs/conversations/entities | |
parent | 5992d4ac0006a473b1dd624a93015683c41e2c10 (diff) |
worked around rare npe
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Message.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 16635f7c..47861d06 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -73,14 +73,21 @@ public class Message extends AbstractEntity { } public Message(Conversation conversation, String body, int encryption, int status) { - this(java.util.UUID.randomUUID().toString(), conversation.getUuid(), - conversation.getContactJid().toBareJid(), null, body, System - .currentTimeMillis(), encryption, - status, TYPE_TEXT, null, null); + this(java.util.UUID.randomUUID().toString(), + conversation.getUuid(), + conversation.getContactJid() == null ? null : conversation.getContactJid().toBareJid(), + null, + body, + System.currentTimeMillis(), + encryption, + status, + TYPE_TEXT, + null, + null); this.conversation = conversation; } - public Message(final String uuid, final String conversationUUid, final Jid counterpart, + private Message(final String uuid, final String conversationUUid, final Jid counterpart, final Jid trueCounterpart, final String body, final long timeSent, final int encryption, final int status, final int type, final String remoteMsgId, final String relativeFilePath) { this.uuid = uuid; |