From 46a35ac1fbfb540bf71791bef40d758ae0da4a27 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 8 Jul 2016 09:19:39 -0400 Subject: [PATCH] Fixed bad NPE when using the WoS. --- changelog.txt | 6 ++++++ .../WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index f125b5b8..e2c38aec 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +------------------------------------------------------ +Version 2.0.2-50 +------------------------------------------------------ +- Fixed bad NPE when using the WoS. (Well, I guess all NPEs are technically bad, but I guess it depends on your perspective. That said, I don't think a changelog is the best place for a theoretical discussion about the rights and wrongs of errors, so I will stop now.) + + ------------------------------------------------------ Version 2.0.2-49 ------------------------------------------------------ diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java index 71fa79cd..0a11baf0 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java @@ -91,7 +91,8 @@ public class RitualWellOfSuffering extends Ritual if (ConfigHandler.wellOfSufferingBlacklist.contains(entity.getClass().getSimpleName())) continue; - if (BloodMagicAPI.getEntitySacrificeValues().get(entity.getClass().getSimpleName()) <= 0) + String simpleClassName = entity.getClass().getSimpleName(); + if (BloodMagicAPI.getEntitySacrificeValues().containsKey(simpleClassName) && BloodMagicAPI.getEntitySacrificeValues().get(simpleClassName) <= 0) continue; if (entity.isEntityAlive() && !(entity instanceof EntityPlayer))