From 2e21759106672005784ddec36f8922c0957e05a5 Mon Sep 17 00:00:00 2001 From: WallSoGB <11296448+WallSoGB@users.noreply.github.com> Date: Sun, 27 Sep 2026 12:06:01 +0200 Subject: [PATCH] Fix CompileScript crashing if called too early --- nvse/nvse/GameScript.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nvse/nvse/GameScript.cpp b/nvse/nvse/GameScript.cpp index 1557223d..aa5bde95 100644 --- a/nvse/nvse/GameScript.cpp +++ b/nvse/nvse/GameScript.cpp @@ -247,8 +247,15 @@ bool Script::Compile(ScriptBuffer* buffer) auto* scriptCompiler = (void*)0xECFDF8; #else constexpr auto address = 0x5AEB90; + ConsoleManager* console = ConsoleManager::GetSingleton(); + if (!console) + return false; + auto* scriptCompiler = ConsoleManager::GetSingleton()->scriptContext; #endif + if (!scriptCompiler) + return false; + return ThisStdCall(address, scriptCompiler, this, buffer); // CompileScript }