Fix NPE in WorldGuardPlugin.wrapOfflinePlayer()

The constructor of BukkitOfflinePlayer calls the constructor of BukkitPlayer with a null player. So without this fix it is not possible to create any BukkitOfflinePlayer.
This commit is contained in:
Brokkonaut 2018-10-05 23:51:08 +02:00
parent a6261b9071
commit be426e92df

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;
}