Don't let display-message crash if no client, from George Nachman.

This commit is contained in:
Nicholas Marriott 2013-03-14 07:31:20 +00:00
parent c5ad47ee7c
commit 3d974b7267

View File

@ -90,7 +90,10 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
msg = format_expand(ft, out);
if (args_has(self->args, 'p'))
cmdq_print(cmdq, "%s", msg);
else
else if (c == NULL) {
cmdq_error(cmdq, "no client available");
return (CMD_RETURN_ERROR);
} else
status_message_set(c, "%s", msg);
free(msg);
format_free(ft);