]> git.sur5r.net Git - i3/i3/commitdiff
Fix a crash when the current output cannot be determined (Thanks Tucos)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 4 Aug 2012 13:19:11 +0000 (15:19 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 4 Aug 2012 13:19:11 +0000 (15:19 +0200)
This is only a cosmetical change though, the fix for the root cause can
be found in the commits following this one.

src/commands.c

index abde85d866cc8d80b78aea9a1fefba1078926c4b..66270f7599fd8e406bd1d5ba93e39d3a73373acf 100644 (file)
@@ -1001,9 +1001,14 @@ void cmd_move_workspace_to_output(I3_CMD, char *name) {
     TAILQ_FOREACH(current, &owindows, owindows) {
         Output *current_output = get_output_containing(current->con->rect.x,
                                                        current->con->rect.y);
+        if (!current_output) {
+            ELOG("Cannot get current output. This is a bug in i3.\n");
+            ysuccess(false);
+            return;
+        }
         Output *output = get_output_from_string(current_output, name);
         if (!output) {
-            LOG("No such output\n");
+            ELOG("Could not get output from string \"%s\"\n", name);
             ysuccess(false);
             return;
         }