Skip to content

Commit

Permalink
fix(core): null pointer exception when refreshing all players (#341)
Browse files Browse the repository at this point in the history
Fixes #326
  • Loading branch information
diogotcorreia authored Nov 1, 2023
1 parent 4fecf2d commit c7b49e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/java/com/rexcantor64/triton/Triton.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.UUID;

@Getter
Expand Down Expand Up @@ -109,8 +110,9 @@ public void reload() {
}

public void refreshPlayers() {
for (LanguagePlayer lp : playerManager.getAll())
lp.refreshAll();
playerManager.getAll().stream()
.filter(Objects::nonNull)
.forEach(LanguagePlayer::refreshAll);
}

public Configuration loadYAML(String fileName, String internalFileName) {
Expand Down

0 comments on commit c7b49e7

Please sign in to comment.