Fix a crash with the chart editor.

This commit is contained in:
EliteMasterEric
2025-02-25 23:42:20 -05:00
parent 4891e54586
commit b35abffd1b
+2 -2
View File
@@ -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<SongDifficulty> = 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);