From b35abffd1b8f5ba134230daa848cbef813e1d41e Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 25 Feb 2025 23:42:20 -0500 Subject: [PATCH] Fix a crash with the chart editor. --- source/funkin/ui/transition/LoadingState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index 90d4936ae..ce9b6b9de 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -214,10 +214,10 @@ class LoadingState extends MusicBeatSubState */ public static function loadPlayState(params:PlayStateParams, shouldStopMusic = false, asSubState = false, ?onConstruct:PlayState->Void):Void { - var daChart = params.targetSong.getDifficulty(params.targetDifficulty ?? Constants.DEFAULT_DIFFICULTY, + var daChart:Null = params.targetSong.getDifficulty(params.targetDifficulty ?? Constants.DEFAULT_DIFFICULTY, params.targetVariation ?? Constants.DEFAULT_VARIATION); - var daStage = funkin.data.stage.StageRegistry.instance.fetchEntry(daChart.stage); + var daStage = funkin.data.stage.StageRegistry.instance.fetchEntry(daChart?.stage ?? Constants.DEFAULT_STAGE); stageDirectory = daStage?._data?.directory ?? "shared"; Paths.setCurrentLevel(stageDirectory);