]> git.sur5r.net Git - i3/i3/blobdiff - src/tree.c
Merge pull request #3342 from orestisf1993/tree_close_internal
[i3/i3] / src / tree.c
index 6b66dd2e5d2fe0ff555959d15e5d0cd938ba67e1..e384987366bd5982f4a430a80b48ed349995e40f 100644 (file)
@@ -92,6 +92,10 @@ bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry) {
 
     DLOG("appended tree, using new root\n");
     croot = TAILQ_FIRST(&(croot->nodes_head));
+    if (!croot) {
+        /* tree_append_json failed. Continuing here would segfault. */
+        goto out;
+    }
     DLOG("new root = %p\n", croot);
     Con *out = TAILQ_FIRST(&(croot->nodes_head));
     DLOG("out = %p\n", out);