Skip to content

Commit

Permalink
Fix potential NPE when a challenge is terminated.
Browse files Browse the repository at this point in the history
  • Loading branch information
A5H73Y committed Jun 10, 2019
1 parent ae35ce3 commit dd1a381
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public void terminateChallenge(Player leaver) {
String terminateMessage = Utils.getTranslation("Parkour.Challenge.Terminated")
.replace("%PLAYER%", leaver.getName());
leaver.sendMessage(terminateMessage);
opponent.sendMessage(terminateMessage);
if (opponent != null) {
opponent.sendMessage(terminateMessage);
}
removeChallenge(challenge);
}
}
Expand Down

0 comments on commit dd1a381

Please sign in to comment.