summaryrefslogtreecommitdiffstats
path: root/cmd-select-pane.c
diff options
context:
space:
mode:
authornicm <nicm>2020-07-03 07:00:12 +0000
committernicm <nicm>2020-07-03 07:00:12 +0000
commit2b1e8d06e18e22e3196c4558f1d300f7088d2417 (patch)
treeab8c75a7e498f36a4b7d328c02c88fb446ca2264 /cmd-select-pane.c
parent2a9bdb700d07a5d0885c22a9e73deaf675ba20c2 (diff)
Check if client is NULL before using it, GitHub issue 2295.
Diffstat (limited to 'cmd-select-pane.c')
-rw-r--r--cmd-select-pane.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index 313deefe..b0c78d74 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -205,7 +205,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
return (CMD_RETURN_NORMAL);
}
- if (c->session != NULL && (c->flags & CLIENT_ACTIVEPANE))
+ if (c != NULL && c->session != NULL && (c->flags & CLIENT_ACTIVEPANE))
activewp = server_client_get_pane(c);
else
activewp = w->active;
@@ -214,7 +214,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (window_push_zoom(w, args_has(args, 'Z')))
server_redraw_window(w);
window_redraw_active_switch(w, wp);
- if (c->session != NULL && (c->flags & CLIENT_ACTIVEPANE))
+ if (c != NULL && c->session != NULL && (c->flags & CLIENT_ACTIVEPANE))
server_client_set_pane(c, wp);
else if (window_set_active_pane(w, wp, 1))
cmd_find_from_winlink_pane(current, wl, wp, 0);