Transfer API WaterPotionStorage#isWaterPotion() needs to check for empty components
Closed this issue ยท 0 comments
net.minecraft.component.ComponentChanges#get()
returns a Nullable Optional<T> value.
Will cause a null pointer exception when the
potionContents.map
method is called
java.lang.NullPointerException: Cannot invoke "java.util.Optional.map(java.util.function.Function)" because "potionContents" is null
at knot//net.fabricmc.fabric.impl.transfer.fluid.WaterPotionStorage.isWaterPotion(WaterPotionStorage.java:56)
at knot//net.fabricmc.fabric.impl.transfer.fluid.WaterPotionStorage.find(WaterPotionStorage.java:50)
at knot//net.fabricmc.fabric.impl.transfer.fluid.CombinedProvidersImpl.lambda$createEvent$0(CombinedProvidersImpl.java:42)
at knot//net.fabricmc.fabric.impl.transfer.fluid.CombinedProvidersImpl$Provider.find(CombinedProvidersImpl.java:80)
at knot//net.fabricmc.fabric.impl.transfer.fluid.CombinedProvidersImpl$Provider.find(CombinedProvidersImpl.java:65)
at knot//net.fabricmc.fabric.impl.lookup.item.ItemApiLookupImpl.find(ItemApiLookupImpl.java:67)
at knot//me.shedaniel.rei.impl.common.compat.FabricFluidAPISupportPlugin.lambda$registerFluidSupport$2(FabricFluidAPISupportPlugin.java:48)