diff --git a/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js b/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js index f1b7e81e8..99b92fec1 100644 --- a/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js +++ b/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js @@ -28,9 +28,15 @@ function createCleanSeriesSelector() { images, alternateTitles, firstCharacter: title.charAt(0).toLowerCase(), - tags: tags.map((id) => { - return allTags.find((tag) => tag.id === id); - }) + tags: tags.reduce((acc, id) => { + const matchingTag = allTags.find((tag) => tag.id === id); + + if (matchingTag) { + acc.push(matchingTag); + } + + return acc; + }, []) }; }); }