summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/opt.c b/src/opt.c
index ffc795b..883d598 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -947,8 +947,12 @@ static struct bfs_expr *visit_shallow(struct bfs_opt *opt, struct bfs_expr *expr
expr = general(opt, expr, visitor);
}
+ if (!expr) {
+ return NULL;
+ }
+
visit_fn *specific = look_up_visitor(expr, visitor->table);
- if (expr && specific) {
+ if (specific) {
expr = specific(opt, expr, visitor);
}