diff --git a/ghost/sodo-search/src/components/PopupModal.js b/ghost/sodo-search/src/components/PopupModal.js index 4c16943726..8fd0f8a31a 100644 --- a/ghost/sodo-search/src/components/PopupModal.js +++ b/ghost/sodo-search/src/components/PopupModal.js @@ -290,14 +290,14 @@ function SearchResultBox() { if (indexComplete && searchValue) { searchResults = searchIndex.search(searchValue); console.log(searchResults); - filteredPosts = searchResults.map((d) => { + filteredPosts = searchResults?.map((d) => { return { id: d?.id, excerpt: d?.excerpt, title: d?.title, slug: d?.slug }; - }); + }) || []; console.log(filteredPosts); }