summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-18 22:11:51 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-18 22:18:44 (GMT)
commitfae758f5a98a0e382a25044259eb2b2ae7e70e53 (patch)
tree7f5086e18f7178ec60905d359adaea53e8141a46
parentbfdabbf4781ab14c9586f8d4e99839f5c567125a (diff)
downloadnetsurf-fae758f5a98a0e382a25044259eb2b2ae7e70e53.tar.gz
netsurf-fae758f5a98a0e382a25044259eb2b2ae7e70e53.tar.bz2
Treeview: Avoid searching empty treeview.
-rw-r--r--desktop/treeview.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c
index d820d15..4841db9 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -806,6 +806,10 @@ static nserror treeview__search(
assert(text[len] == '\0');
+ if (tree->root == NULL) {
+ return NSERROR_OK;
+ }
+
err = treeview_walk_internal(tree, tree->root,
TREEVIEW_WALK_MODE_LOGICAL_COMPLETE, NULL,
treeview__search_walk_cb, &sw);