Skip to content

Commit

Permalink
fix: 🐛 check if window is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmannZ committed Nov 20, 2023
1 parent 23b963b commit 77d52d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/get-zaraz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* an error. Else returns the zaraz object.
*/
export function getZaraz() {
if (!window?.zaraz) {
if (typeof window !== 'undefined' && !window?.zaraz) {
throw new Error(
`Cannot use Zaraz Web API, because window.zaraz is not defined.`,
);
Expand Down

0 comments on commit 77d52d6

Please sign in to comment.