summaryrefslogtreecommitdiffstats
path: root/src/opt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt.c')
-rw-r--r--src/opt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/opt.c b/src/opt.c
index b74b4e1..883d598 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -25,11 +25,11 @@
* effects are reachable at all, skipping the traversal if not.
*/
+#include "prelude.h"
#include "opt.h"
#include "bftw.h"
#include "bit.h"
#include "color.h"
-#include "config.h"
#include "ctx.h"
#include "diag.h"
#include "dir.h"
@@ -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);
}