diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-05-29 21:25:27 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-05-29 21:25:27 +0200 |
commit | ea18ceae4adfaed63879673fa0109778caf97fbd (patch) | |
tree | 1955b1f50d5d4eda7c204a680c24824f5dcb94e7 /src/main | |
parent | 71787bd2e1fbfe6faf34a38378a90c5df19e9ba1 (diff) |
avoid npe when sending omemo messages to group
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/MessageGenerator.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java index 823af397..09c88293 100644 --- a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java @@ -12,6 +12,7 @@ import java.util.TimeZone; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage; import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; @@ -81,7 +82,8 @@ public class MessageGenerator extends AbstractGenerator { } private static boolean recipientSupportsOmemo(Message message) { - return message.getContact().getPresences().allOrNonSupport(AxolotlService.PEP_DEVICE_LIST_NOTIFY); + Contact c = message.getContact(); + return c != null && c.getPresences().allOrNonSupport(AxolotlService.PEP_DEVICE_LIST_NOTIFY); } public static void addMessageHints(MessagePacket packet) { |