From 0f859514377453ea1b0a40cd217ff3e2c67d4c81 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 63595655cd5..b980d3e821f 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);