Merge pull request #389 from Brokkonaut/fix-npe-BukkitOfflinePlayer

Fix NPE in WorldGuardPlugin.wrapOfflinePlayer()
This commit is contained in:
Matthew Miller 2018-10-08 23:20:11 +10:00 committed by GitHub
commit e0b91e9529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ public BukkitPlayer(WorldGuardPlugin plugin, Player player) {
super((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"), player);
this.plugin = plugin;
// getName() takes longer than before in newer versions of Minecraft
this.name = player.getName();
this.name = player == null ? null : player.getName();
this.silenced = silenced;
}