From 239832a74afffeea5324104f363b2eb3b39b7dfa Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Wed, 26 Jul 2023 16:19:49 +0200 Subject: [PATCH] Variable - When calling `replace(Statement, Statement)`, if we hit the `variableAssignment` replacement check, first check and ensure it is not null`, try --- source/tlang/compiler/symbols/data.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/tlang/compiler/symbols/data.d b/source/tlang/compiler/symbols/data.d index deb6f5b..6f7acef 100644 --- a/source/tlang/compiler/symbols/data.d +++ b/source/tlang/compiler/symbols/data.d @@ -508,11 +508,16 @@ public class Variable : TypedEntity, MStatementSearchable, MStatementReplaceable assignment = cast(VariableAssignment)that; return true; } - /* Recurse on the variable assignment */ - else + /* Recurse on the variable assignment (if there is one) */ + else if(assignment !is null) { return assignment.replace(thiz, that); } + /* Exhausted all possibilities */ + else + { + return false; + } } /**