summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-11 09:06:48 +1000
committermd_5 <git@md-5.net>2018-07-11 09:06:48 +1000
commitca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a (patch)
treeb39081802df70c7089875d0a31651fff23b81db4
parentab13683d8e636bf10f2fe7702b01c33e4737bba1 (diff)
downloadcraftbukkit-ca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a.tar
craftbukkit-ca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a.tar.gz
craftbukkit-ca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a.tar.lz
craftbukkit-ca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a.tar.xz
craftbukkit-ca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a.zip
Add validation checks to CraftPlayer.teleport
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1866d521..4c44a198 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -487,6 +487,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
+ Preconditions.checkArgument(location != null, "location");
+ Preconditions.checkArgument(location.getWorld() != null, "location.world");
+ location.checkFinite();
+
EntityPlayer entity = getHandle();
if (getHealth() == 0 || entity.dead) {