summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authornicm <nicm>2019-04-23 09:15:24 +0000
committernicm <nicm>2019-04-23 09:15:24 +0000
commit6752f41c2a5ddfe2ac41ffd6a658a0f387b75804 (patch)
tree98dc947aad6a22a1fb3a80f34cc99ea0cc8299b1 /layout.c
parent5b9211d827dec53c8a90f35846ff52d663d4c0d1 (diff)
Do not try to resize if the parent cell is NULL, problem reported by
Sunil Nimmagadda.
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/layout.c b/layout.c
index f974e10d..86d307ef 100644
--- a/layout.c
+++ b/layout.c
@@ -414,9 +414,9 @@ layout_destroy_cell(struct window *w, struct layout_cell *lc,
lcother = TAILQ_NEXT(lc, entry);
else
lcother = TAILQ_PREV(lc, layout_cells, entry);
- if (lcparent->type == LAYOUT_LEFTRIGHT)
+ if (lcother != NULL && lcparent->type == LAYOUT_LEFTRIGHT)
layout_resize_adjust(w, lcother, lcparent->type, lc->sx + 1);
- else
+ else if (lcother != NULL)
layout_resize_adjust(w, lcother, lcparent->type, lc->sy + 1);
/* Remove this from the parent's list. */