Skip to content

Commit

Permalink
fix: Fix crash when mod returns null container TwelveIterationMods/Co…
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Jan 11, 2025
1 parent 9e56c68 commit 3adc91f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

public class FabricBalm implements ModInitializer {

private static final SidedProxy<FabricBalmProxy> proxy = sidedProxy("net.blay09.mods.balm.fabric.FabricBalmProxy", "net.blay09.mods.balm.fabric.client.FabricBalmClientProxy");
private static final SidedProxy<FabricBalmProxy> proxy = sidedProxy("net.blay09.mods.balm.fabric.FabricBalmProxy",
"net.blay09.mods.balm.fabric.client.FabricBalmClientProxy");

@Override
public void onInitialize() {
Expand All @@ -44,7 +45,10 @@ public void onInitialize() {

ItemStorage.SIDED.registerFallback((world, pos, state, blockEntity, direction) -> {
if (blockEntity instanceof BalmContainerProvider containerProvider) {
return InventoryStorage.of(containerProvider.getContainer(direction), direction);
final var container = containerProvider.getContainer(direction);
if (container != null) {
return InventoryStorage.of(container, direction);
}
}

return null;
Expand Down

0 comments on commit 3adc91f

Please sign in to comment.