Check for a null player object in the PlayerTeleportEvent.

This commit is contained in:
ElgarL 2012-01-25 22:35:24 +00:00
parent ae2cf3d95c
commit e563405a7d
2 changed files with 3 additions and 2 deletions

View File

@ -120,3 +120,4 @@ v 1.9:
- Allow negation to the * permission node when populating superperms.
- Fix trying to modify an unmodifiable collection breaking superperms.
- Fixed subgroups (I broke earlier).
- Check for a null player object in the PlayerTeleportEvent.

View File

@ -397,7 +397,7 @@ public class BukkitPermissions {
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerTeleport(PlayerTeleportEvent event) { // can be teleported into another world
if ((event.getTo() != null) && (!event.getFrom().getWorld().equals(event.getTo().getWorld()))) { // only if world actually changed
if ((event.getTo() != null) && (event.getPlayer() != null) && (!event.getFrom().getWorld().equals(event.getTo().getWorld()))) { // only if world actually changed
updatePermissions(event.getPlayer(), event.getTo().getWorld().getName());
}
}