From 4da2a9b07a02c78ba8f3a5c24f0d846e98805eb9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 16 Apr 2014 09:47:03 +1000 Subject: [PATCH] Validate CraftSkull getOwner - prevents it from being called when hasOwner is false. --- .../0140-Validate-CraftSkull-getOwner.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CraftBukkit-Patches/0140-Validate-CraftSkull-getOwner.patch diff --git a/CraftBukkit-Patches/0140-Validate-CraftSkull-getOwner.patch b/CraftBukkit-Patches/0140-Validate-CraftSkull-getOwner.patch new file mode 100644 index 0000000000..08a6d19339 --- /dev/null +++ b/CraftBukkit-Patches/0140-Validate-CraftSkull-getOwner.patch @@ -0,0 +1,21 @@ +From a131ef3c4f7aacc6beb1af01a7ad73a24b46eea4 Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Wed, 16 Apr 2014 09:46:48 +1000 +Subject: [PATCH] Validate CraftSkull getOwner + + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +index d544760..29778c0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +@@ -146,6 +146,7 @@ public class CraftSkull extends CraftBlockState implements Skull { + } + + public String getOwner() { ++ com.google.common.base.Preconditions.checkState( hasOwner(), "Cannot call getOwner if skull has no owner!" ); // Spigot + return profile.getName(); + } + +-- +1.8.3.2 +