Fix an issue where a missing stage would cause a crash (rather than an error popup)

This commit is contained in:
EliteMasterEric 2024-04-06 22:38:32 -04:00
parent ea1d123c49
commit b464f51ba2

View file

@ -1551,10 +1551,11 @@ class PlayState extends MusicBeatSubState
function loadStage(id:String):Void
{
currentStage = StageRegistry.instance.fetchEntry(id);
currentStage.revive(); // Stages are killed and props destroyed when the PlayState is destroyed to save memory.
if (currentStage != null)
{
currentStage.revive(); // Stages are killed and props destroyed when the PlayState is destroyed to save memory.
// Actually create and position the sprites.
var event:ScriptEvent = new ScriptEvent(CREATE, false);
ScriptEventDispatcher.callEvent(currentStage, event);