diff --git a/lib/ical/helpers.js b/lib/ical/helpers.js index b4fdb94f..71860bf0 100644 --- a/lib/ical/helpers.js +++ b/lib/ical/helpers.js @@ -4,10 +4,10 @@ * Portions Copyright (C) Philipp Kewisch, 2011-2015 */ -if ('noModule' in HTMLScriptElement.prototype) { - // In case ical.js is executed in a JavaScript module, strict mode is enabled - // and requires a global variable to be assigned explicitly to e.g. the window - // object. +if (typeof window !== 'undefined' && 'noModule' in HTMLScriptElement.prototype) { + // In case ical.js is executed in the browser and a JavaScript module, strict + // mode is enabled and requires a global variable to be assigned explicitly + // to e.g. the window object. window.ICAL = {}; }