From 1418d6fb7f637398d5dab48e99b072244cfed96e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 27 Jul 2016 02:01:15 +0200 Subject: [PATCH] Add some more null checks to Drill's block harvesting. Should close #175 --- .../actuallyadditions/mod/items/ItemDrill.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java index 56b7a9121..d526c279f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -501,11 +501,16 @@ public class ItemDrill extends ItemEnergy{ } private boolean hasExtraWhitelist(Block block){ - String name = block.getRegistryName().toString(); - if(name != null){ - for(String list : ConfigStringListValues.DRILL_EXTRA_MINING_WHITELIST.getValue()){ - if(list.equals(name)){ - return true; + if(block != null){ + ResourceLocation location = block.getRegistryName(); + if(location != null){ + String name = location.toString(); + if(name != null){ + for(String s : ConfigStringListValues.DRILL_EXTRA_MINING_WHITELIST.getValue()){ + if(s != null && s.equals(name)){ + return true; + } + } } } }