From 79f2d68e60a4ca8405469ef41ef67c16089a7f81 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Tue, 20 Mar 2012 17:30:57 -0700 Subject: [PATCH] Handle empty damage values in WorldEdit.getBlock(). Fixes #921 --- src/main/java/com/sk89q/worldedit/WorldEdit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/WorldEdit.java b/src/main/java/com/sk89q/worldedit/WorldEdit.java index d11ae2685..362b15b05 100644 --- a/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -340,7 +340,7 @@ public class WorldEdit { if (data == -1) { // Block data not yet detected // Parse the block data (optional) try { - data = typeAndData.length > 1 ? Integer.parseInt(typeAndData[1]) : (allowNoData ? -1 : 0); + data = (typeAndData.length > 1 && typeAndData[1].length() > 0) ? Integer.parseInt(typeAndData[1]) : (allowNoData ? -1 : 0); if (data > 15 || (data < 0 && !(allAllowed && data == -1))) { data = 0; }