summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-11-12 21:15:14 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-11-12 21:15:14 +0100
commit0720b6679e247224128f52e4a30e24513dad06b5 (patch)
treeb1246d1c6ab5d37c5b5482512be037126e4b1439
parent1a50278a1ad9f68fa591fe032220e1a7b8a59ee2 (diff)
downloadlr-0720b6679e247224128f52e4a30e24513dad06b5.tar.gz
lr-0720b6679e247224128f52e4a30e24513dad06b5.tar.xz
lr-0720b6679e247224128f52e4a30e24513dad06b5.zip
fitree_walk: don't crash on empty tree
-rw-r--r--lr.c2
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);