Permalink
Browse files

Added NPE check to prevent a crash when certain config options are un…

…used.
  • Loading branch information...
1 parent cb86024 commit fa6393b95bc700b6fece328db028ec90d1a77968 @SirSengir SirSengir committed Apr 1, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 common/buildcraft/BuildCraftTransport.java
View
12 common/buildcraft/BuildCraftTransport.java
@@ -238,15 +238,19 @@ public void preInitialize(FMLPreInitializationEvent evt) {
Property exclusionItemList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.item.exclusion", new String[0]);
String[] excludedItemBlocks = exclusionItemList.getStringList();
- for (int j = 0; j < excludedItemBlocks.length; ++j) {
- excludedItemBlocks[j] = excludedItemBlocks[j].trim();
+ if(excludedItemBlocks != null) {
+ for (int j = 0; j < excludedItemBlocks.length; ++j) {
+ excludedItemBlocks[j] = excludedItemBlocks[j].trim();
+ }
}
Property exclusionLiquidList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.liquid.exclusion", new String[0]);
String[] excludedLiquidBlocks = exclusionLiquidList.getStringList();
- for (int j = 0; j < excludedLiquidBlocks.length; ++j) {
- excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
+ if(excludedLiquidBlocks != null) {
+ for (int j = 0; j < excludedLiquidBlocks.length; ++j) {
+ excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
+ }
}
PipeManager.registerExtractionHandler(new ExtractionHandler(excludedItemBlocks, excludedLiquidBlocks));

0 comments on commit fa6393b

Please sign in to comment.