Fix Null object Reference (#337)

* Fix Null object Reference

When you pause in a specific time in the countdown (when the countdown is finishing) it crashs.

I just added a null check for the song to fix it.

* Update PlayState.hx
This commit is contained in:
TheoDev
2024-08-27 01:12:35 +02:00
committed by GitHub
parent abb8449ca2
commit 6c34dbf620
+1 -1
View File
@@ -1260,7 +1260,7 @@ class PlayState extends MusicBeatState
if (Conductor.songPosition >= 0)
startSong();
}
} else {
} else if (FlxG.sound.music != null) {
var instTime = FlxG.sound.music.time;
var isOffsync = vocals.time != instTime || [for(strumLine in strumLines.members) strumLine.vocals.time != instTime].contains(true);
__vocalOffsetViolation = Math.max(0, __vocalOffsetViolation + (isOffsync ? elapsed : -elapsed / 2));