From ca6d2cf9dc5b03193dfc77362d395cbe8b32eb4a Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 11 Jul 2018 09:06:48 +1000 Subject: Add validation checks to CraftPlayer.teleport --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- cgit v1.2.3