From: Michael Stapelberg Date: Wed, 19 Jan 2011 08:31:31 +0000 (+0100) Subject: Bugfix: fix crash in tree_flatten (Thanks mseed) X-Git-Tag: tree-pr2~114 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3fe4146e24b3830f2a6a5d8c5d4bbb0e2f256070;p=i3%2Fi3 Bugfix: fix crash in tree_flatten (Thanks mseed) --- diff --git a/src/tree.c b/src/tree.c index 721e0b9c..48a25eb2 100644 --- a/src/tree.c +++ b/src/tree.c @@ -525,7 +525,7 @@ void tree_flatten(Con *con) { /* Ensure it got only one child */ child = TAILQ_FIRST(&(con->nodes_head)); - if (TAILQ_NEXT(child, nodes) != NULL) + if (child == NULL || TAILQ_NEXT(child, nodes) != NULL) goto recurse; /* The child must have a different orientation than the con but the same as