From 3f267b25ff66519a3ca22bff7b30a0ce841e81e9 Mon Sep 17 00:00:00 2001 From: Mingfei Shao Date: Tue, 14 Jan 2025 13:29:58 -0600 Subject: [PATCH] fix: only allow string typed tags --- src/Discovery/DiscoveryDropdownTagViewer.tsx | 2 +- src/Discovery/DiscoveryTagViewer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discovery/DiscoveryDropdownTagViewer.tsx b/src/Discovery/DiscoveryDropdownTagViewer.tsx index a6312113d1..3a41d16cfc 100644 --- a/src/Discovery/DiscoveryDropdownTagViewer.tsx +++ b/src/Discovery/DiscoveryDropdownTagViewer.tsx @@ -27,7 +27,7 @@ const DiscoveryDropdownTagViewer: React.FunctionComponent { - if (tag.category === category.name) { + if (typeof tag.name === 'string' && tag.category === category.name) { tagMap[tag.name] = 1; } }); diff --git a/src/Discovery/DiscoveryTagViewer.tsx b/src/Discovery/DiscoveryTagViewer.tsx index 3d72bb5f3e..2cbf9b6a40 100644 --- a/src/Discovery/DiscoveryTagViewer.tsx +++ b/src/Discovery/DiscoveryTagViewer.tsx @@ -27,7 +27,7 @@ const DiscoveryTagViewer: React.FunctionComponent = (pr const tagField = props.config.minimalFieldMapping.tagsListFieldName; if (study[tagField]) { study[tagField].forEach((tag) => { - if (tag.category === category.name) { + if (typeof tag.name === 'string' && tag.category === category.name) { tagMap[tag.name] = 1; } });