From 7595343aaac23ed4e374a900723f020d8ab89fa5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 Nov 2016 18:02:07 +0100 Subject: [PATCH] - fixed: Completely empty if statements left the code generator in a broken state. --- src/scripting/codegeneration/codegen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index 3577ac1ec..e38b6bd6b 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -7946,7 +7946,8 @@ FxExpression *FxIfStatement::Resolve(FCompileContext &ctx) if (WhenTrue == nullptr && WhenFalse == nullptr) { // We don't do anything either way, so disappear delete this; - return nullptr; + ScriptPosition.Message(MSG_WARNING, "empty if statement"); + return new FxNop(ScriptPosition); } SAFE_RESOLVE(Condition, ctx);