about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/xmpp/message.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 09863b63..e795953b 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -922,6 +922,13 @@ _private_chat_handler(xmpp_stanza_t *const stanza)
     }
 #endif
 
+    if (!message->plain && !message->body) {
+        log_error("Message received without body from: %s", jid->str);
+        goto out;
+    } else if (!message->plain) {
+        message->plain = strdup(message->body);
+    }
+
     message->timestamp = stanza_get_delay(stanza);
     message->body = xmpp_message_get_body(stanza);