diff --git a/src/main/java/net/minecraftforge/fluids/FluidStack.java b/src/main/java/net/minecraftforge/fluids/FluidStack.java index 962633149..c18e18e70 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidStack.java +++ b/src/main/java/net/minecraftforge/fluids/FluidStack.java @@ -23,7 +23,12 @@ public class FluidStack public FluidStack(Fluid fluid, int amount) { - if (!FluidRegistry.isFluidRegistered(fluid)) + if (fluid == null) + { + FMLLog.bigWarning("Null fluid supplied to fluidstack. Did you try and create a stack for an unregistered fluid?"); + throw new IllegalArgumentException("Cannot create a fluidstack from a null fluid"); + } + else if (!FluidRegistry.isFluidRegistered(fluid)) { FMLLog.bigWarning("Failed attempt to create a FluidStack for an unregistered Fluid %s (type %s)", fluid.getName(), fluid.getClass().getName()); throw new IllegalArgumentException("Cannot create a fluidstack from an unregistered fluid");