From ced4c57f19c945e0eb07b412ce7bde13ce682f6d Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 22 May 2017 15:01:18 +0200 Subject: [PATCH] Check if we are in a browser environment before trying to load the JS --- js/cast.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/cast.js b/js/cast.js index e813f2d..f693a92 100644 --- a/js/cast.js +++ b/js/cast.js @@ -104,4 +104,6 @@ var castModule = (function () { }; }()); -window.addEventListener('load', castModule.init, false); +if (typeof window === 'object') { + window.addEventListener('load', castModule.init, false); +}