Fix nullptr and item_slot check