From 2766b263c409ec9dd3f91313500ed4c41ba8892f Mon Sep 17 00:00:00 2001 From: IntegratedQuantum Date: Sun, 30 Mar 2025 19:30:11 +0200 Subject: [PATCH] check if the item in the crafting inventory is null before using it. fixes #1256 --- src/Inventory.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Inventory.zig b/src/Inventory.zig index f9577958..6f4b0aeb 100644 --- a/src/Inventory.zig +++ b/src/Inventory.zig @@ -1000,6 +1000,7 @@ pub const Command = struct { // MARK: Command std.debug.assert(dest.inv.type == .normal); if(source.slot != source.inv._items.len - 1) return; if(dest.ref().item != null and !std.meta.eql(dest.ref().item, source.ref().item)) return; + if(source.ref().item == null) return; // Can happen if the we didn't receive the inventory information from the server yet. if(dest.ref().amount + source.ref().amount > source.ref().item.?.stackSize()) return; const playerInventory: Inventory = switch(side) {