diff --git a/cmd-select-layout.c b/cmd-select-layout.c index 106b8ce7b..93cdb413b 100644 --- a/cmd-select-layout.c +++ b/cmd-select-layout.c @@ -91,7 +91,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'p')) previous = 1; - if (c->flags & CLIENT_CONTROL && + if (c != NULL && c->flags & CLIENT_CONTROL && ~c->flags & CLIENT_CONTROL_NEWLAYOUTS) flags |= LAYOUT_CUSTOM_OLD_FORMAT; diff --git a/layout.c b/layout.c index edf4eab7e..6cca384a8 100644 --- a/layout.c +++ b/layout.c @@ -106,7 +106,7 @@ layout_free_cell(struct layout_cell *lc, int only_nodes) } break; case LAYOUT_WINDOWPANE: - if (lc->wp != NULL) { + if (lc->wp != NULL && lc->wp->layout_cell != NULL) { lc->wp->layout_cell->parent = NULL; lc->wp->layout_cell = NULL; }