degesch: fix segfault on sent messages w/o buffer

This commit is contained in:
Přemysl Eric Janouch 2016-02-12 04:04:35 +01:00
parent 11519ee860
commit 06b03d336e

View File

@ -5194,6 +5194,10 @@ irc_get_buffer_for_message (struct server *s,
} }
else if (!buffer) else if (!buffer)
{ {
// Outgoing messages needn't have a prefix, no buffer associated
if (!msg->prefix)
return NULL;
// Don't make user buffers for servers (they can send NOTICEs) // Don't make user buffers for servers (they can send NOTICEs)
if (!irc_find_userhost (msg->prefix)) if (!irc_find_userhost (msg->prefix))
return s->buffer; return s->buffer;