diff --git a/utils/visionUtils.ts b/utils/visionUtils.ts index a32ee26..d1d84f0 100644 --- a/utils/visionUtils.ts +++ b/utils/visionUtils.ts @@ -23,7 +23,7 @@ export const scanProduct = async (imageData: string): Promise<{ name: string; qu // Filter out generic labels const specificLabels = labels.filter(label => - !['Food', 'Produce', 'Natural foods', 'Fruit', 'Vegetable'].includes(label.description) + label.description && !['Food', 'Produce', 'Natural foods', 'Fruit', 'Vegetable'].includes(label.description) ); if (specificLabels.length > 0) { @@ -45,4 +45,4 @@ export const scanProduct = async (imageData: string): Promise<{ name: string; qu console.error('Error in scanProduct:', error); throw new Error(`Failed to scan product: ${error.message}`); } -}; \ No newline at end of file +};