Fix crash with null fluid stack (#193)

* fix crash with null fluid stack

* change minimum stack size in bookmarks

Co-authored-by: Serghei Borovetchi <[email protected]>
This commit is contained in:
slprimeandSerghei Borovetchi authored and GitHub committed 2022-01-07 09:06:05 -08:00
1 parent 2d18dcf42b
commit 144a37cebb
3 files changed
+20 -15

No files matched your search

@@ -31,12 +31,15 @@ public class GTFluidStackStringifyHandler implements IStackStringifyHandler
{
if (GTDisplayFluid != null && GTDisplayFluid.isInstance(stack.getItem())) {
final NBTTagCompound nbTag = new NBTTagCompound();
final FluidStack fluidStack = getFluid(stack);
nbTag.setString("gtFluidName", fluidStack.getFluid().getName());
nbTag.setInteger("Count", saveStackSize? fluidStack.amount: 1);
return nbTag;
if (fluidStack != null) {
final NBTTagCompound nbTag = new NBTTagCompound();
nbTag.setString("gtFluidName", fluidStack.getFluid().getName());
nbTag.setInteger("Count", saveStackSize? fluidStack.amount: 1);
return nbTag;
}
}
return null;