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()); } }