Prevent infinite loop with invalid Inventory format