aboutsummaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-04-10 11:54:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-04-10 11:54:09 -0400
commitccb9e367047148f5b15316b667a139106858ab61 (patch)
tree3ff97768608a244dbb25db1ac9fa1357c3467bfd /ast.c
parent0f9c1f4eb4fcbabec313d13205ef81e47fd8456c (diff)
Fix empty string check
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ast.c b/ast.c
index 25309e93..e841089e 100644
--- a/ast.c
+++ b/ast.c
@@ -202,7 +202,7 @@ bool is_constant(ast_t *ast)
case Bool: case Int: case Num: case Nil: case TextLiteral: return true;
case TextJoin: {
auto text = Match(ast, TextJoin);
- return !text->children->next;
+ return !text->children || !text->children->next;
}
case Not: return is_constant(Match(ast, Not)->value);
case Negative: return is_constant(Match(ast, Negative)->value);