From 772c19a770ea2708004fb72d05d3f98bf339c224 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 11 Jul 2018 09:06:48 +1000 Subject: [PATCH] Add validation checks to CraftPlayer.teleport By: md_5 --- .../main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 1866d5210f..4c44a1988c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/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) {