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
1 changed files with 4 additions and 0 deletions

View File

@ -5194,6 +5194,10 @@ irc_get_buffer_for_message (struct server *s,
}
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)
if (!irc_find_userhost (msg->prefix))
return s->buffer;