diff options
-rw-r--r-- | src/ui/chatwin.c | 6 | ||||
-rw-r--r-- | src/ui/mucwin.c | 5 | ||||
-rw-r--r-- | src/ui/privwin.c | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index c7cf8ddb..32fd3553 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -310,6 +310,12 @@ void chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_created) { assert(chatwin != NULL); + + if (message->plain == NULL) { + log_error("chatwin_incoming_msg: Message with no plain field from: %s", message->from_jid); + return; + } + char* old_plain = message->plain; message->plain = plugins_pre_chat_message_display(message->from_jid->barejid, message->from_jid->resourcepart, message->plain); diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index b48a4a54..3c4d7447 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -551,6 +551,11 @@ mucwin_incoming_msg(ProfMucWin* mucwin, const ProfMessage* const message, GSList assert(mucwin != NULL); int flags = 0; + if (message->plain == NULL) { + log_error("mucwin_incoming_msg: Message with no plain field from: %s", message->from_jid); + return; + } + if (filter_reflection && message_is_sent_by_us(message, TRUE)) { /* Ignore reflection messages */ return; diff --git a/src/ui/privwin.c b/src/ui/privwin.c index 20611ea4..b683a839 100644 --- a/src/ui/privwin.c +++ b/src/ui/privwin.c @@ -39,6 +39,7 @@ #include <glib.h> #include <stdlib.h> +#include "log.h" #include "config/preferences.h" #include "ui/win_types.h" #include "ui/window.h" @@ -50,6 +51,11 @@ privwin_incoming_msg(ProfPrivateWin* privatewin, ProfMessage* message) { assert(privatewin != NULL); + if (message->plain == NULL) { + log_error("privwin_incoming_msg: Message with no plain field from: %s", message->from_jid); + return; + } + ProfWin* window = (ProfWin*)privatewin; int num = wins_get_num(window); |