Skip to content
This repository
Browse code

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

…used.
  • Loading branch information...
commit fa6393b95bc700b6fece328db028ec90d1a77968 1 parent cb86024
SirSengir SirSengir authored

Showing 1 changed file with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. +8 4 common/buildcraft/BuildCraftTransport.java
12 common/buildcraft/BuildCraftTransport.java
@@ -238,15 +238,19 @@ public void preInitialize(FMLPreInitializationEvent evt) {
238 238 Property exclusionItemList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.item.exclusion", new String[0]);
239 239
240 240 String[] excludedItemBlocks = exclusionItemList.getStringList();
241   - for (int j = 0; j < excludedItemBlocks.length; ++j) {
242   - excludedItemBlocks[j] = excludedItemBlocks[j].trim();
  241 + if(excludedItemBlocks != null) {
  242 + for (int j = 0; j < excludedItemBlocks.length; ++j) {
  243 + excludedItemBlocks[j] = excludedItemBlocks[j].trim();
  244 + }
243 245 }
244 246
245 247 Property exclusionLiquidList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.liquid.exclusion", new String[0]);
246 248
247 249 String[] excludedLiquidBlocks = exclusionLiquidList.getStringList();
248   - for (int j = 0; j < excludedLiquidBlocks.length; ++j) {
249   - excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
  250 + if(excludedLiquidBlocks != null) {
  251 + for (int j = 0; j < excludedLiquidBlocks.length; ++j) {
  252 + excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
  253 + }
250 254 }
251 255
252 256 PipeManager.registerExtractionHandler(new ExtractionHandler(excludedItemBlocks, excludedLiquidBlocks));

0 comments on commit fa6393b

Please sign in to comment.
Something went wrong with that request. Please try again.