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

Port of c7b49e7 to v4
  • Loading branch information
diogotcorreia committed Nov 3, 2023
1 parent 24581b1 commit ac5af6d
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 @@ -29,6 +29,7 @@
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Objects;
import java.util.UUID;

@Getter
Expand Down Expand Up @@ -113,8 +114,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 ac5af6d

Please sign in to comment.