diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-11-12 21:15:14 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-11-12 21:15:14 +0100 |
commit | 0720b6679e247224128f52e4a30e24513dad06b5 (patch) | |
tree | b1246d1c6ab5d37c5b5482512be037126e4b1439 | |
parent | 1a50278a1ad9f68fa591fe032220e1a7b8a59ee2 (diff) | |
download | lr-0720b6679e247224128f52e4a30e24513dad06b5.tar.gz lr-0720b6679e247224128f52e4a30e24513dad06b5.tar.xz lr-0720b6679e247224128f52e4a30e24513dad06b5.zip |
fitree_walk: don't crash on empty tree
-rw-r--r-- | lr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lr.c b/lr.c index ae19843..d5fff03 100644 --- a/lr.c +++ b/lr.c @@ -1535,6 +1535,8 @@ fitree_insert(struct fitree *node, struct fileinfo *fi) void fitree_walk(struct fitree *node, void (*visit)(struct fileinfo *)) { + if (!node) + return; if (node->left != &fitree_sentinel) fitree_walk(node->left, visit); visit(node->fi); |