From 1a41c7c194eb84d2466e9896e7b7489f3e2fa641 Mon Sep 17 00:00:00 2001 From: Shailesh Pandit Date: Wed, 5 Jan 2022 14:43:25 +0530 Subject: [PATCH] Fix getUnidentifiedFaces for empty face crops --- src/utils/machineLearning/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/machineLearning/index.ts b/src/utils/machineLearning/index.ts index 47fe5da96..990c8284e 100644 --- a/src/utils/machineLearning/index.ts +++ b/src/utils/machineLearning/index.ts @@ -374,8 +374,11 @@ export async function getUnidentifiedFaces( .map((f) => f.faceCrop) .filter((faceCrop) => faceCrop !== null && faceCrop !== undefined); - return Promise.all( - faceCrops.map((faceCrop) => getFaceImageBlobFromStorage(faceCrop)) + return ( + faceCrops && + Promise.all( + faceCrops.map((faceCrop) => getFaceImageBlobFromStorage(faceCrop)) + ) ); }