summaryrefslogtreecommitdiffstats
path: root/window-tree.c
diff options
context:
space:
mode:
authornicm <nicm>2018-03-29 08:03:51 +0000
committernicm <nicm>2018-03-29 08:03:51 +0000
commit803b8815bd7a61fb050f4dde83f0f3446e045c09 (patch)
treefe4e944e4f4af63204a2cc0f856af919b2ff7a2e /window-tree.c
parent194e9f611bf275ec36e50c82cca129cde7e9eb18 (diff)
Do not crash on empty window, reported by Jamie Macdonald in GitHub
issue 1299. Patch from Thomas Adam.
Diffstat (limited to 'window-tree.c')
-rw-r--r--window-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/window-tree.c b/window-tree.c
index 8a327bb6..926eaec1 100644
--- a/window-tree.c
+++ b/window-tree.c
@@ -296,7 +296,8 @@ window_tree_build_window(struct session *s, struct winlink *wl, void* modedata,
free(text);
free(name);
- wp = TAILQ_FIRST(&wl->window->panes);
+ if ((wp = TAILQ_FIRST(&wl->window->panes)) == NULL)
+ goto empty;
if (TAILQ_NEXT(wp, entry) == NULL) {
if (!window_tree_filter_pane(s, wl, wp, filter))
goto empty;