We should return "" not null for 'corrupt' signs.

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot 2013-03-18 20:33:22 +11:00
parent 5ade077442
commit 082176c726

View File

@ -1,4 +1,4 @@
From 289f93ad3e999628f5d13a5da0fa2939cccbb5dd Mon Sep 17 00:00:00 2001
From 03f9257d5a0ba384c73251024050cebfe4fc348a Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 18 Mar 2013 20:01:44 +1100
Subject: [PATCH] Prevent NPE in CraftSign
@ -9,7 +9,7 @@ This commit prevents the constructor of CraftSign throwing an NPE when it cannot
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
index 8e8a1c5..8b7d226 100644
index 8e8a1c5..87af049 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
@@ -14,6 +14,12 @@ public class CraftSign extends CraftBlockState implements Sign {
@ -18,7 +18,7 @@ index 8e8a1c5..8b7d226 100644
sign = (TileEntitySign) world.getTileEntityAt(getX(), getY(), getZ());
+ // Spigot start
+ if (sign == null) {
+ lines = new String[4];
+ lines = new String[]{"", "", "", ""};
+ return;
+ }
+ // Spigot end