aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd.c b/cmd.c
index b0f785f9..21f2052f 100644
--- a/cmd.c
+++ b/cmd.c
@@ -299,8 +299,8 @@ cmd_current_session(struct cmd_ctx *ctx)
u_int i;
int found;
- if (ctx->cursession != NULL)
- return (ctx->cursession);
+ if (ctx->curclient != NULL && ctx->curclient->session != NULL)
+ return (ctx->curclient->session);
/*
* If the name of the calling client's pty is know, build a list of the