prevent a nullpointer, save a life
This commit is contained in:
parent
7c763f4f66
commit
413e937c13
|
@ -344,7 +344,12 @@ public class MainMenu extends BaseOpsuState {
|
||||||
Fonts.loadGlyphs(Fonts.MEDIUM, beatmap.artistUnicode);
|
Fonts.loadGlyphs(Fonts.MEDIUM, beatmap.artistUnicode);
|
||||||
}
|
}
|
||||||
final Image np = GameImage.MUSIC_NOWPLAYING.getImage();
|
final Image np = GameImage.MUSIC_NOWPLAYING.getImage();
|
||||||
final String trackText = beatmap.getArtist() + ": " + beatmap.getTitle();
|
final String trackText;
|
||||||
|
if (beatmap != null) {
|
||||||
|
trackText = beatmap.getArtist() + ": " + beatmap.getTitle();
|
||||||
|
} else {
|
||||||
|
trackText = "Loading...";
|
||||||
|
}
|
||||||
final float textWidth = Fonts.MEDIUM.getWidth(trackText);
|
final float textWidth = Fonts.MEDIUM.getWidth(trackText);
|
||||||
final float npheight = Fonts.MEDIUM.getLineHeight() * 1.15f;
|
final float npheight = Fonts.MEDIUM.getLineHeight() * 1.15f;
|
||||||
final float npscale = npheight / np.getHeight();
|
final float npscale = npheight / np.getHeight();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user