summaryrefslogtreecommitdiffstats
path: root/cmd-detach-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-detach-client.c')
-rw-r--r--cmd-detach-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd-detach-client.c b/cmd-detach-client.c
index 82001bee..d40ef5a0 100644
--- a/cmd-detach-client.c
+++ b/cmd-detach-client.c
@@ -71,7 +71,8 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq)
if (args_has(args, 'a')) {
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c2 = ARRAY_ITEM(&clients, i);
- if (c2 == NULL || c == c2)
+ if (c2 == NULL || c2->session == NULL ||
+ c2 == c)
continue;
server_write_client(c2, msgtype,
c2->session->name,