From 39b1a42cfeafe2b7be8b66e2fe529e853d9ae197 Mon Sep 17 00:00:00 2001 From: lemz Date: Mon, 30 Sep 2024 21:29:36 +0200 Subject: [PATCH] fix: fix crash in LatencyState when exiting / cleaning up state data --- source/funkin/ui/debug/latency/LatencyState.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/latency/LatencyState.hx b/source/funkin/ui/debug/latency/LatencyState.hx index 63595655c..b980d3e82 100644 --- a/source/funkin/ui/debug/latency/LatencyState.hx +++ b/source/funkin/ui/debug/latency/LatencyState.hx @@ -199,7 +199,11 @@ class LatencyState extends MusicBeatSubState PreciseInputManager.instance.onInputPressed.remove(preciseInputPressed); PreciseInputManager.instance.onInputReleased.remove(preciseInputReleased); - FlxG.sound.music.volume = previousVolume; + if (FlxG.sound.music != null) + { + FlxG.sound.music.volume = previousVolume; + } + swagSong.stop(); FlxG.sound.list.remove(swagSong);