Skip to content

Commit

Permalink
touch up
Browse files Browse the repository at this point in the history
  • Loading branch information
frostyfan109 committed Oct 29, 2024
1 parent ecc63f0 commit bb1a78b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/search/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit bb1a78b

Please sign in to comment.