summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2024-03-01 20:32:17 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2024-03-02 16:58:43 -0500
commitce94a168f6a10455e98e2be7bd905bb9fb7f7fc1 (patch)
tree92feb51444a8e1b4bd49f8996329f6823a60a63a
parent95e93cfd56c8dec57a3bb2627d7714944713c37a (diff)
add check for null pointer, avoid dereferencing
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--src/Tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Tree.c b/src/Tree.c
index 9be7a24..5c6fcd5 100644
--- a/src/Tree.c
+++ b/src/Tree.c
@@ -903,7 +903,7 @@ arrange_subtree(TreeWidget tree, Widget w, int depth, int x, int y)
/*
* now layout parent between first and last children
*/
- if (relayout) {
+ if (relayout && (child != NULL)) {
Position adjusted;
TreeConstraints firstcc = TREE_CONSTRAINT (tc->tree.children[0]);
TreeConstraints lastcc = TREE_CONSTRAINT (child);