From caeab76abbf527b4da1cafa0f883aa784a87c206 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Wed, 14 Dec 2011 10:51:02 +0100 Subject: [PATCH] Fixed a NullPointerException in conjunction with CraftBook. Thanks FearThe1337. --- src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index fcdd2a080..0b5a41b0b 100644 --- a/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -189,8 +189,8 @@ public class CuboidRegion implements Region { } } - pos1 = pos1.clampY(0, world.getMaxY()); - pos2 = pos2.clampY(0, world.getMaxY()); + pos1 = pos1.clampY(0, world == null ? 127 : world.getMaxY()); + pos2 = pos2.clampY(0, world == null ? 127 : world.getMaxY()); } /**