3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00
Paper/CraftBukkit-Patches/0139-Validate-CraftSkull-getOwner.patch

22 Zeilen
790 B
Diff

From 36a609b6a7bf7ad658a1018997921c7bd0faf612 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
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