From 105539f28cccffe6caa2a5777682c7c722fb949c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 29 Dec 2012 18:40:44 -0600 Subject: [PATCH] Don't allow nulls in PlayerRespawnEvent. Fixes BUKKIT-2571 By: feildmaster --- .../main/java/org/bukkit/event/player/PlayerRespawnEvent.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java index dcfc87838e..48a07c29b6 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java @@ -1,5 +1,6 @@ package org.bukkit.event.player; +import org.apache.commons.lang.Validate; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; @@ -30,6 +31,9 @@ public class PlayerRespawnEvent extends PlayerEvent { * @param respawnLocation new location for the respawn */ public void setRespawnLocation(Location respawnLocation) { + Validate.notNull(respawnLocation, "Respawn location can not be null"); + Validate.notNull(respawnLocation.getWorld(), "Respawn world can not be null"); + this.respawnLocation = respawnLocation; }