From db392bc0f2fd8fcf6f74b8a76147684d200a6fc5 Mon Sep 17 00:00:00 2001 From: Tahg Date: Tue, 10 Jan 2012 00:20:03 -0500 Subject: Further fix to Location. --- src/main/java/org/bukkit/Location.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java index 4afabd88..3760f5a2 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -373,8 +373,10 @@ public class Location implements Cloneable { */ public double distanceSquared(Location o) { if (o == null) { + throw new IllegalArgumentException("Cannot measure distance to a null location"); + } else if (o.getWorld() == null || getWorld() == null) { throw new IllegalArgumentException("Cannot measure distance to a null world"); - } else if (o == null || o.getWorld() != getWorld()) { + } else if (o.getWorld() != getWorld()) { throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getName() + " and " + o.getWorld().getName()); } -- cgit v1.2.3