From aa3d9f4a8a97fb1fc4788f7601a7fb743e1535ca Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 12 Nov 2020 14:25:38 +0100 Subject: [PATCH] Fix NPE Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/utils/FightStatistics.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java index 0b948b3..23fcdf4 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/utils/FightStatistics.java @@ -47,6 +47,8 @@ public class FightStatistics { public static void saveStats(FightTeam winner, String windescription){ String gameMode = Config.SchematicType.toDB(); + if(!Fight.getBlueTeam().hasTeamLeader() || !Fight.getRedTeam().hasTeamLeader()) + return; SteamwarUser blueLeader = SteamwarUser.get(Fight.getBlueTeam().getLeader().getPlayer().getUniqueId()); SteamwarUser redLeader = SteamwarUser.get(Fight.getRedTeam().getLeader().getPlayer().getUniqueId()); int win = 0;