From: Orestis Floros Date: Thu, 15 Nov 2018 11:48:14 +0000 (+0200) Subject: randr.c: Fix regression with focusing NULL container X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F3524%2Fhead;p=i3%2Fi3 randr.c: Fix regression with focusing NULL container This was introduced in db3b9e41874400958cf85b461a5d1ff04a398fa3 which removed the NULL check for next. Fixes #3523. --- diff --git a/src/randr.c b/src/randr.c index c0dec7f6..fb127ab5 100644 --- a/src/randr.c +++ b/src/randr.c @@ -974,10 +974,12 @@ void randr_disable_output(Output *output) { } } - /* Restore focus after con_detach / con_attach */ - DLOG("now focusing next = %p\n", next); - con_focus(next); - workspace_show(con_get_workspace(next)); + /* Restore focus after con_detach / con_attach. next can be NULL, see #3523. */ + if (next) { + DLOG("now focusing next = %p\n", next); + con_focus(next); + workspace_show(con_get_workspace(next)); + } /* 3: move the dock clients to the first output */ Con *child;