diff options
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index 632d6317..89e4e725 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -181,7 +181,17 @@ public class CraftSkull extends CraftBlockState implements Skull { @Override public OfflinePlayer getOwningPlayer() { - return hasOwner() ? Bukkit.getOfflinePlayer(profile.getId()) : null; + if (profile != null) { + if (profile.getId() != null) { + return Bukkit.getOfflinePlayer(profile.getId()); + } + + if (profile.getName() != null) { + return Bukkit.getOfflinePlayer(profile.getName()); + } + } + + return null; } @Override |