]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: fix crash when layout JSON file is partially invalid (Thanks xeen)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 4 Jan 2014 20:22:12 +0000 (21:22 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 4 Jan 2014 20:22:12 +0000 (21:22 +0100)
Fixes #1145

src/load_layout.c

index 9373441a87246372dad408c0972229d9a65b95bb..1e240ee655eafaee0267a5a73c9f390f2920d8f9 100644 (file)
@@ -436,6 +436,11 @@ void tree_append_json(const char *filename) {
         unsigned char *str = yajl_get_error(hand, 1, (const unsigned char*)buf, n);
         ELOG("JSON parsing error: %s\n", str);
         yajl_free_error(hand, str);
+
+        /* In case not all containers were restored, we need to fix the
+         * percentages, otherwise i3 will crash immediately when rendering the
+         * next time. */
+        con_fix_percent(focused);
     }
 
     setlocale(LC_NUMERIC, "");