From be9d5650d12daf226a419040b7994e5636d44715 Mon Sep 17 00:00:00 2001 From: lunarcleint Date: Mon, 24 Feb 2025 16:08:35 -0700 Subject: [PATCH] fix crash loading stages --- source/funkin/game/Stage.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/game/Stage.hx b/source/funkin/game/Stage.hx index c3e9b4fa..1a48d065 100644 --- a/source/funkin/game/Stage.hx +++ b/source/funkin/game/Stage.hx @@ -52,7 +52,7 @@ class Stage extends FlxBasic implements IBeatReceiver { for (k=>e in stageSprites) script.set(k, e); public function prepareInfos(node:Access) - return XMLImportedScriptInfo.prepareInfos(node, PlayState.instance.scripts, (infos) -> xmlImportedScripts.push(infos)); + return PlayState.instance == null ? null : XMLImportedScriptInfo.prepareInfos(node, PlayState.instance.scripts, (infos) -> xmlImportedScripts.push(infos)); public function new(stage:String, ?state:FlxState, autoLoad:Bool = true) { super();