MenuInventory: Prevent invalid memory access