Skip to content

Module - Temp Perms: NPE with the infect goal. #19

Description

@TerraPrimal

As requested by the almighty slipcor, I hereby present this ticket with an NPE.
https://pastebin.com/8jNfWq59

Basically, the NPE is thrown when a player goes from the free team in the lounge to the infected team when the game starts.
The player is still in the middle of the team transition when their team is trying to be checked.
I solved this my end by wrapping line 157 in a null check for Team and Class as well as a 1 tick delay. I am sure there is a more elegant solution.

BukkitRunnable r = new BukkitRunnable()
{
@OverRide
public void run()
{
if (aPlayer.getArenaTeam() != null && aPlayer.getArenaClass() != null)
{
setPermissions(arena, aPlayer, getTempPerms(arena, "default"), getTempPerms(arena, aPlayer.getArenaTeam().getName()));
}
}
};
r.runTaskLater(PVPArena.instance, 1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions