diff options
author | nicm <nicm> | 2018-03-29 08:03:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2018-03-29 13:19:19 +0100 |
commit | 8a81993ae156a898740947d3bd57ddc9f37567c1 (patch) | |
tree | 783203b706a2a35a2904534225186d4cd6d9de18 /window-tree.c | |
parent | 785ce66ab9fd68ce4b2ba8d26ed6dba4c17bf714 (diff) | |
download | rtmux-8a81993ae156a898740947d3bd57ddc9f37567c1.tar.gz rtmux-8a81993ae156a898740947d3bd57ddc9f37567c1.tar.bz2 rtmux-8a81993ae156a898740947d3bd57ddc9f37567c1.zip |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/window-tree.c b/window-tree.c index 3c587cb9..2c466b36 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; |