Do not use client if NULL, from Thomas Adam.

This commit is contained in:
Nicholas Marriott 2020-05-07 05:55:42 +01:00
parent 66ecb1dff4
commit 63e17d8cad

View File

@ -540,11 +540,12 @@ cmdq_add_message(struct cmdq_item *item)
{ {
struct client *c = item->client; struct client *c = item->client;
struct cmdq_state *state = item->state; struct cmdq_state *state = item->state;
const char *name = c->name, *key; const char *name, *key;
char *tmp; char *tmp;
tmp = cmd_print(item->cmd); tmp = cmd_print(item->cmd);
if (c != NULL) { if (c != NULL) {
name = c->name;
if (c->session != NULL && state->event.key != KEYC_NONE) { if (c->session != NULL && state->event.key != KEYC_NONE) {
key = key_string_lookup_key(state->event.key); key = key_string_lookup_key(state->event.key);
server_add_message("%s key %s: %s", name, key, tmp); server_add_message("%s key %s: %s", name, key, tmp);