From d7280f6d6914e7a53fd54e091068236ffb1d49ec Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Mon, 1 Apr 2013 22:42:21 +0200 Subject: [PATCH] Fix for #110 (NPE for empty BlackList-String-Entry) --- .../minecraft/limitedcreative/limits/BlackList.java | 3 ++- .../minecraft/limitedcreative/limits/BlackListEntity.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackList.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackList.java index 6bd5aef..d85067a 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackList.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackList.java @@ -74,7 +74,8 @@ public class BlackList extends ArrayList implements Confi add((Blacklisted) el); } else { try { - add(el.toString()); + if (el != null) + add(el.toString()); } catch (InvalidValueException e) { System.err.println(e.getCause().getMessage()); } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackListEntity.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackListEntity.java index 40e33e8..3d3b68f 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackListEntity.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlackListEntity.java @@ -66,7 +66,8 @@ public class BlackListEntity extends ArrayList impl add((Blacklisted) el); } else { try { - add(el.toString()); + if (el != null) + add(el.toString()); } catch (InvalidValueException e) { System.err.println((e.getCause() != null ? e.getCause() : e).getMessage()); }