]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
Update doc/specification.tex
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index 7f6841fb96aea414e5d7f6afa78922b4f7d995f3..294c13b42dc175f369db95f6101868041b43a670 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -660,8 +660,10 @@ ast_array_index* ast_array_index_new(lex_ctx ctx, ast_expression *array, ast_exp
 
 void ast_array_index_delete(ast_array_index *self)
 {
-    ast_unref(self->array);
-    ast_unref(self->index);
+    if (self->array)
+        ast_unref(self->array);
+    if (self->index)
+        ast_unref(self->index);
     ast_expression_delete((ast_expression*)self);
     mem_d(self);
 }