Do not crash if no client.

This commit is contained in:
nicm
2026-07-02 08:47:25 +00:00
parent 3ef51a469c
commit 0ad5035457

View File

@@ -1012,7 +1012,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
strcmp(target, "{active}") == 0 || strcmp(target, "{active}") == 0 ||
strcmp(target, "{current}") == 0) { strcmp(target, "{current}") == 0) {
c = cmdq_get_client(item); c = cmdq_get_client(item);
if (c == NULL) { if (c == NULL || c->session == NULL) {
cmdq_error(item, "no current client"); cmdq_error(item, "no current client");
goto error; goto error;
} }