From 3d974b7267e1e9073930a065d7a0f206f3d975f6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 14 Mar 2013 07:31:20 +0000 Subject: [PATCH] Don't let display-message crash if no client, from George Nachman. --- cmd-display-message.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd-display-message.c b/cmd-display-message.c index 319280ba..4ff3f97f 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -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);