mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Validate CraftSkull getOwner - prevents it from being called when hasOwner is false.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
16d77f8f5e
commit
c22ab5cf24
1 changed files with 21 additions and 0 deletions
21
CraftBukkit-Patches/0140-Validate-CraftSkull-getOwner.patch
Normal file
21
CraftBukkit-Patches/0140-Validate-CraftSkull-getOwner.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
From a131ef3c4f7aacc6beb1af01a7ad73a24b46eea4 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
|
||||
|
Loading…
Reference in a new issue