From edc77ca2d4b23845dfa879f673598749dfab4259 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 20 Jan 2024 17:51:44 +0100 Subject: [PATCH] Fix Name if leader null Signed-off-by: Lixfel --- FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java index b2933bd..0fba538 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java @@ -50,7 +50,8 @@ public class GUI { @SuppressWarnings("deprecation") private static void addTeamRequest(Player p, SWInventory inv, int pos, FightTeam team) { byte colorCode = ColorConverter.chat2dye(team.getColor()).getDyeData(); - inv.setItem(pos, SWItem.getDye(colorCode), colorCode, msg.parse("JOIN_REQUEST_TEAM", p, team.getColor() + team.getLeader().getEntity().getName()), click -> { + String name = team.getLeader() != null ? team.getLeader().getEntity().getName() : team.getName(); + inv.setItem(pos, SWItem.getDye(colorCode), colorCode, msg.parse("JOIN_REQUEST_TEAM", p, team.getColor() + name), click -> { p.closeInventory(); new JoinRequest(p, team); });