From 6f0f5ea6102d4646e0321d2f9927355151c623ad Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 15 Jan 2024 15:33:28 -0500 Subject: [PATCH] Fix a crash when closing chart editor with no music playing --- source/funkin/ui/debug/charting/ChartEditorState.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 0853bf390..e98809ce8 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -5951,9 +5951,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState ChartEditorNoteSprite.noteFrameCollection = null; // Stop the music. - welcomeMusic.destroy(); - audioInstTrack.destroy(); - audioVocalTrackGroup.destroy(); + if (welcomeMusic != null) welcomeMusic.destroy(); + if (audioInstTrack != null) audioInstTrack.destroy(); + if (audioVocalTrackGroup != null) audioVocalTrackGroup.destroy(); } function applyCanQuickSave():Void