Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
Fix crash when players were null
Browse files Browse the repository at this point in the history
  • Loading branch information
DAMcraft committed Feb 12, 2024
1 parent e6ca88c commit c1c7c5f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import static de.damcraft.serverseeker.ServerSeeker.gson;
import static meteordevelopment.meteorclient.MeteorClient.mc;
Expand Down Expand Up @@ -52,7 +53,7 @@ public static void update() {
ServerInfoResponse resp = gson.fromJson(jsonResp, ServerInfoResponse.class);

for (HistoricPlayersHud hud : huds) {
hud.players = resp.players;
hud.players = Objects.requireNonNullElseGet(resp.players, List::of);
hud.isCracked = resp.cracked;
}
}
Expand Down

0 comments on commit c1c7c5f

Please sign in to comment.