Fixed NPE when an invite gets rejected

This commit is contained in:
Florian CUNY 2018-08-31 20:46:53 +02:00
parent 07547472b8
commit 4b9e8f1e0e

View File

@ -47,7 +47,9 @@ public class IslandTeamInviteRejectCommand extends CompositeCommand {
user.sendMessage("commands.island.team.invite.reject.you-rejected-invite"); user.sendMessage("commands.island.team.invite.reject.you-rejected-invite");
User inviter = User.getInstance(itc.getInviteCommand().getInviteList().get(playerUUID)); User inviter = User.getInstance(itc.getInviteCommand().getInviteList().get(playerUUID));
if (inviter != null) {
inviter.sendMessage("commands.island.team.invite.reject.name-rejected-your-invite", TextVariables.NAME, user.getName()); inviter.sendMessage("commands.island.team.invite.reject.name-rejected-your-invite", TextVariables.NAME, user.getName());
}
} else { } else {
// Someone typed /island reject and had not been invited // Someone typed /island reject and had not been invited
// TODO: make the error nicer if there are invites in other worlds // TODO: make the error nicer if there are invites in other worlds