fix null on invitedPlayer (#1972)

This commit is contained in:
Huynh Tien 2022-04-28 19:39:39 +07:00 committed by GitHub
parent 385aed02cd
commit 3e0368fbab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,8 @@ public class IslandTeamInviteCommand extends CompositeCommand {
@Override
public boolean execute(User user, String label, List<String> args) {
// Rare case when invited player is null. Could be a race condition.
if (invitedPlayer == null) return false;
// If that player already has an invite out then retract it.
// Players can only have one invite one at a time - interesting
if (itc.isInvited(invitedPlayer.getUniqueId())) {