Handle null player check in resetWorldBorder method.

Previously, the method assumed the player object was never null, which could cause potential issues. This update adds a null check to ensure stability and prevent unexpected errors when invoking the resetWorldBorder method.
This commit is contained in:
Teriuihi 2025-02-26 22:40:58 +01:00
parent c738f02d17
commit 14158f73b8

View File

@ -60,8 +60,8 @@ public class TeamPlayer {
isDead = true;
}
public void resetWorldBorder(@NotNull Player player, WorldBorderApi worldBorderApi, GamePhase gamePhase, Location worldBorderCenter) {
if (!player.isOnline()) {
public void resetWorldBorder(Player player, WorldBorderApi worldBorderApi, GamePhase gamePhase, Location worldBorderCenter) {
if (player == null || !player.isOnline()) {
return;
}
WorldBorderSettings worldBorderSettings = GameConfig.WORLD_BORDER.getGAME_PHASE_WORLD_BORDER().get(gamePhase);