From bcd68d9ca1d4b64e66dc508d4c6588e82290ec9f Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 27 May 2009 12:15:23 +0200 Subject: [PATCH] Bugfix: Fix crash when focusing/moving on an empty workspace (Thanks Mirko) --- src/commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands.c b/src/commands.c index ee2f6e61..f54787a9 100644 --- a/src/commands.c +++ b/src/commands.c @@ -831,7 +831,7 @@ void parse_command(xcb_connection_t *conn, const char *command) { /* Is it just 's' for stacking or 'd' for default? */ if ((command[0] == 's' || command[0] == 'd') && (command[1] == '\0')) { - if (last_focused->floating) { + if (last_focused == NULL || last_focused->floating) { LOG("not switching, this is a floating client\n"); return; } @@ -903,14 +903,14 @@ void parse_command(xcb_connection_t *conn, const char *command) { } if (*rest == '\0') { - if (last_focused->floating) + if (last_focused != NULL && last_focused->floating) move_floating_window_to_workspace(conn, last_focused, workspace); else move_current_window_to_workspace(conn, workspace); return; } - if (last_focused->floating) { - LOG("Not performing because this is a floating window\n"); + if (last_focused == NULL || last_focused->floating) { + LOG("Not performing (null or floating) \n"); return; }