Skip to content

Commit 6bf033b

Browse files
author
nicm
committed
Do not crash if display-message used without a client, issue reported by
Serge Aleynikov, fix from Thomas Adam.
1 parent 43f292b commit 6bf033b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd-display-message.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
7878
msg = format_expand_time(ft, template, time(NULL));
7979
if (args_has(self->args, 'p'))
8080
cmdq_print(cmdq, "%s", msg);
81-
else
81+
else if (c != NULL)
8282
status_message_set(c, "%s", msg);
8383
free(msg);
84+
8485
format_free(ft);
8586

8687
return (CMD_RETURN_NORMAL);

0 commit comments

Comments
 (0)