Skip to content

Commit

Permalink
Fixed null error
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlrxxh committed Mar 2, 2024
1 parent 9d110b9 commit 98509a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/me/lrxh/practice/match/MatchListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down

0 comments on commit 98509a1

Please sign in to comment.