fix crash when spotify is not present
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m26s

This commit is contained in:
Daniella / Tove 2024-06-25 10:54:57 +02:00
parent 54533140d2
commit 465e2be922
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -227,7 +227,7 @@ public class HUD extends Feature {
infoString += " | "; infoString += " | ";
if (showPing) if (showPing)
infoString += "Ping: " + (ServerDataManager.ping + (pingJitter ? (int) (Math.random() * pingJitterAmount) : 0)) + " | Players: " + ServerDataManager.players + "/" + ServerDataManager.maxPlayers + "\n"; infoString += "Ping: " + (ServerDataManager.ping + (pingJitter ? (int) (Math.random() * pingJitterAmount) : 0)) + " | Players: " + ServerDataManager.players + "/" + ServerDataManager.maxPlayers + "\n";
if (showSpotify) { if (showSpotify && Features.isFeatureEnabled(Spotify.class)) {
SpotifyAPI api = Features.getFeature(Spotify.class).api; SpotifyAPI api = Features.getFeature(Spotify.class).api;
if (api != null && api.isConnected() && api.hasPosition() && api.hasTrack()) { if (api != null && api.isConnected() && api.hasPosition() && api.hasTrack()) {