Do not crash when the current session has no window, fixes a bug

reported by Giorgio Lando. Fix from Thomas Adam.
This commit is contained in:
Nicholas Marriott 2012-06-18 09:20:19 +00:00
parent 2113115cdd
commit a4a2c68fa9
1 changed files with 2 additions and 2 deletions

2
cmd.c
View File

@ -1304,7 +1304,7 @@ cmd_get_default_path(struct cmd_ctx *ctx, const char *cwd)
/* Empty or relative path. */ /* Empty or relative path. */
if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL) if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL)
root = ctx->cmdclient->cwd; root = ctx->cmdclient->cwd;
else if (ctx->curclient != NULL) else if (ctx->curclient != NULL && s->curw != NULL)
root = get_proc_cwd(s->curw->window->active->pid); root = get_proc_cwd(s->curw->window->active->pid);
else else
return (s->cwd); return (s->cwd);