From fd25e0822dc864646b96244cecd152fdd3b3f902 Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Fri, 27 Apr 2018 12:49:57 +0100 Subject: [PATCH] fix crash when raytrace result is null #2090 (#2105) --- .../forestry/core/items/ItemFluidContainerForestry.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/forestry/core/items/ItemFluidContainerForestry.java b/src/main/java/forestry/core/items/ItemFluidContainerForestry.java index d7d3c270f..eaa5eb942 100755 --- a/src/main/java/forestry/core/items/ItemFluidContainerForestry.java +++ b/src/main/java/forestry/core/items/ItemFluidContainerForestry.java @@ -77,7 +77,7 @@ public class ItemFluidContainerForestry extends ItemForestry { if (this.isInCreativeTab(tab)) { // empty subItems.add(new ItemStack(this)); - + // filled for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) { ItemStack itemStack = new ItemStack(this); @@ -194,9 +194,9 @@ public class ItemFluidContainerForestry extends ItemForestry { return new ActionResult<>(EnumActionResult.FAIL, heldItem); } } else { - if(Config.CapsuleFluidPickup) { + if (Config.CapsuleFluidPickup) { RayTraceResult target = this.rayTrace(world, player, true); - if (target.typeOfHit != RayTraceResult.Type.BLOCK) { + if (target == null || target.typeOfHit != RayTraceResult.Type.BLOCK) { return ActionResult.newResult(EnumActionResult.PASS, heldItem); }