Skip to content

Commit

Permalink
check if languages are actually defined
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Sep 1, 2023
1 parent a23b0ae commit 533ac48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ const Header = ({ siteTitle, languages, language }) => {
* that we can use to retrieve languages when using header on the
* index page so we need to set languages hard
*/
languages.forEach((l) => setLangs((prev) => new Set(prev.add(l))))
if (typeof languages !== "undefined") {
languages.forEach((l) => setLangs((prev) => new Set(prev.add(l))))
}
})
}, [pathName, languages])

Expand Down

0 comments on commit 533ac48

Please sign in to comment.