]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Fix crash when focusing/moving on an empty workspace (Thanks Mirko)
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 27 May 2009 10:15:23 +0000 (12:15 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 27 May 2009 10:15:23 +0000 (12:15 +0200)
src/commands.c

index ee2f6e61ee5f75c324a51faa06a4232765eb8e15..f54787a9e9a56f5fea09859662454121fdc158d5 100644 (file)
@@ -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;
         }