From 0848844f2d41055f6ffc69af1149d7a873460976 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 24 Aug 2011 00:55:11 +0200 Subject: [PATCH] Bugfix: Fix 'focus mode_toggle' on an empty workspace (Thanks BeF) Fixes #487 --- src/cmdparse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5