NPE when do some command on offline player

This commit is contained in:
Michel Roux 2012-05-19 21:23:31 +02:00
parent d443b464d4
commit a120301bef

View File

@ -156,6 +156,7 @@ public class SimplyPlugin extends JavaPlugin {
protected void refreshPlayerPermissions(String player) { protected void refreshPlayerPermissions(String player) {
refreshConfig(); refreshConfig();
if (getServer().getPlayer(player) == null) return;
PermissionAttachment attachment = permissions.get(getServer().getPlayer(player).getName()); PermissionAttachment attachment = permissions.get(getServer().getPlayer(player).getName());
for (String key : attachment.getPermissions().keySet()) { for (String key : attachment.getPermissions().keySet()) {
attachment.unsetPermission(key); attachment.unsetPermission(key);