diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 3adb901d3..e50863efb 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -10299,9 +10299,14 @@ FxWhileLoop::~FxWhileLoop() FxExpression *FxWhileLoop::DoResolve(FCompileContext &ctx) { CHECKRESOLVED(); - SAFE_RESOLVE(Condition, ctx); + SAFE_RESOLVE_OPT(Condition, ctx); SAFE_RESOLVE_OPT(Code, ctx); + if (Condition == nullptr) + { + Condition = new FxConstant(true, ScriptPosition); + } + if (Condition->ValueType != TypeBool) { Condition = new FxBoolCast(Condition);