diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 5f0e04ebf..d90ade3fe 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -4862,8 +4862,10 @@ void AstNode::add_to_module_fast_lookup(dict& module_fast dict AstNode::generate_module_fast_lookup_for_genblock_expansion() { dict module_fast_lookup; - for (auto& node : current_ast_mod->children) { - add_to_module_fast_lookup(module_fast_lookup, node.get()); + if (current_ast_mod) { + for (auto& node : current_ast_mod->children) { + add_to_module_fast_lookup(module_fast_lookup, node.get()); + } } return module_fast_lookup; }