=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/key-bindings.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- src/usr.bin/tmux/key-bindings.c 2012/04/01 13:18:38 1.30 +++ src/usr.bin/tmux/key-bindings.c 2012/06/18 09:58:02 1.31 @@ -1,4 +1,4 @@ -/* $OpenBSD: key-bindings.c,v 1.30 2012/04/01 13:18:38 nicm Exp $ */ +/* $OpenBSD: key-bindings.c,v 1.31 2012/06/18 09:58:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -207,6 +207,9 @@ va_list ap; char *msg; + if (ctx->curclient->session == NULL) + return; + va_start(ap, fmt); xvasprintf(&msg, fmt, ap); va_end(ap); @@ -219,9 +222,13 @@ void printflike2 key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...) { - struct winlink *wl = ctx->curclient->session->curw; + struct winlink *wl; va_list ap; + if (ctx->curclient->session == NULL) + return; + + wl = ctx->curclient->session->curw; if (wl->window->active->mode != &window_copy_mode) { window_pane_reset_mode(wl->window->active); window_pane_set_mode(wl->window->active, &window_copy_mode); @@ -238,6 +245,9 @@ { va_list ap; char *msg; + + if (ctx->curclient->session == NULL) + return; if (options_get_number(&global_options, "quiet")) return;