From bb1a78b4cd3b5153ee0895a23387e7476f59885a Mon Sep 17 00:00:00 2001 From: frostyfan109 Date: Tue, 29 Oct 2024 18:00:04 -0400 Subject: [PATCH] touch up --- src/components/search/context.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/search/context.js b/src/components/search/context.js index 1a03bbbf..4e229d1a 100644 --- a/src/components/search/context.js +++ b/src/components/search/context.js @@ -406,11 +406,14 @@ export const HelxSearch = ({ children }) => { } return [...studies] }, []) - return cdesOnly ? cdesOnly[0] : null + return cdesOnly.length > 0 ? cdesOnly[0] : null } catch (error) { /** Forward AbortError upwards. Handle other errors here. */ if (error.name === "CanceledError") throw error - else console.error(error) + else { + console.error(error) + return null + } } }, [helxSearchUrl])