prevent possible(?) nullpointer by auto unboxing

This commit is contained in:
yugecin 2018-07-08 00:32:53 +02:00
parent d412a2e39e
commit 4338513180
No known key found for this signature in database
GPG Key ID: 2C5AC035A7068E44

View File

@ -295,7 +295,7 @@ public class MainMenu extends BaseOpsuState {
Float beatPosition = MusicController.getBeatProgress();
Float beatLength = MusicController.getBeatLength();
final boolean renderPiece = beatPosition != null;
if (beatPosition == null) {
if (beatPosition == null || beatLength == null) {
beatPosition = System.currentTimeMillis() % 1000 / 1000f;
beatLength = 1000f;
}