Bugfix: Fix 'focus mode_toggle' on an empty workspace (Thanks BeF)

Fixes #487
This commit is contained in:
Michael Stapelberg 2011-08-24 00:55:11 +02:00
parent 3f147b77ab
commit 0848844f2d

View File

@ -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;
}