Bugfix: fix crash when layout JSON file is partially invalid (Thanks xeen)
Fixes #1145
This commit is contained in:
parent
b109b1b20d
commit
4a9e283f05
|
@ -436,6 +436,11 @@ void tree_append_json(const char *filename) {
|
||||||
unsigned char *str = yajl_get_error(hand, 1, (const unsigned char*)buf, n);
|
unsigned char *str = yajl_get_error(hand, 1, (const unsigned char*)buf, n);
|
||||||
ELOG("JSON parsing error: %s\n", str);
|
ELOG("JSON parsing error: %s\n", str);
|
||||||
yajl_free_error(hand, 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, "");
|
setlocale(LC_NUMERIC, "");
|
||||||
|
|
Loading…
Reference in New Issue