From: Michael Stapelberg Date: Tue, 23 Aug 2011 22:55:11 +0000 (+0200) Subject: Bugfix: Fix 'focus mode_toggle' on an empty workspace (Thanks BeF) X-Git-Tag: 4.0.2~32^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0848844f2d41055f6ffc69af1149d7a873460976;p=i3%2Fi3 Bugfix: Fix 'focus mode_toggle' on an empty workspace (Thanks BeF) Fixes #487 --- diff --git a/src/cmdparse.y b/src/cmdparse.y index 9b63ff0c..d271c997 100644 --- a/src/cmdparse.y +++ b/src/cmdparse.y @@ -484,7 +484,7 @@ focus: int to_focus = $2; if ($2 == TOK_MODE_TOGGLE) { current = TAILQ_FIRST(&(ws->focus_head)); - if (current->type == CT_FLOATING_CON) + if (current != NULL && current->type == CT_FLOATING_CON) to_focus = TOK_TILING; else to_focus = TOK_FLOATING; }