From 98509a1378a6213eae7163802c9452ba0d76c5b0 Mon Sep 17 00:00:00 2001 From: nodyt Date: Sat, 2 Mar 2024 22:51:42 +0100 Subject: [PATCH] Fixed null error --- src/main/java/me/lrxh/practice/match/MatchListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/lrxh/practice/match/MatchListener.java b/src/main/java/me/lrxh/practice/match/MatchListener.java index e84c60b..92f18d8 100644 --- a/src/main/java/me/lrxh/practice/match/MatchListener.java +++ b/src/main/java/me/lrxh/practice/match/MatchListener.java @@ -511,10 +511,10 @@ public void onFoodLevelChange(FoodLevelChangeEvent event) { public void onPlayerQuitEvent(PlayerQuitEvent event) { Profile profile = Profile.getProfiles().get(event.getPlayer().getUniqueId()); - if (profile.getState() == ProfileState.FIGHTING) { + if (profile != null && profile.getState() == ProfileState.FIGHTING) { Match match = profile.getMatch(); - if (match.getState() == MatchState.STARTING_ROUND || match.getState() == MatchState.PLAYING_ROUND) { + if (match != null && (match.getState() == MatchState.STARTING_ROUND || match.getState() == MatchState.PLAYING_ROUND)) { profile.getMatch().onDisconnect(event.getPlayer()); } }