From 758c816fa99686fed6ff9d3c881ff0cdc2fb1e11 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Tue, 15 Mar 2022 13:24:10 +0530 Subject: [PATCH] fix bug --- src/components/MachineLearning/ObjectList.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/MachineLearning/ObjectList.tsx b/src/components/MachineLearning/ObjectList.tsx index 706647f96..b595fcfaf 100644 --- a/src/components/MachineLearning/ObjectList.tsx +++ b/src/components/MachineLearning/ObjectList.tsx @@ -11,9 +11,9 @@ export function ObjectLabelList(props: { file: EnteFile }) { const things = await mlIDbStorage.getAllThingsMap(); const uniqueObjectNames = [ ...new Set( - things - .get(props.file.id) - .map((object) => object.detection.class) + (things.get(props.file.id) ?? []).map( + (object) => object.detection.class + ) ), ]; !didCancel && setObjects(uniqueObjectNames);