From: Michael Stapelberg Date: Sat, 4 Jan 2014 20:22:12 +0000 (+0100) Subject: Bugfix: fix crash when layout JSON file is partially invalid (Thanks xeen) X-Git-Tag: 4.8~163 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4a9e283f0521b28596f32a8e6f6db9f2d51d9a4f;p=i3%2Fi3 Bugfix: fix crash when layout JSON file is partially invalid (Thanks xeen) Fixes #1145 --- diff --git a/src/load_layout.c b/src/load_layout.c index 9373441a..1e240ee6 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -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, "");