From 7b1831186e28c062f9a196b35ec37d7ca164db9b Mon Sep 17 00:00:00 2001 From: Martti Laine Date: Thu, 27 Oct 2016 00:17:20 +0300 Subject: [PATCH 1/2] Check if window is defined before assigning to it #22 --- gator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gator.js b/gator.js index 25fe1d1..fce905f 100644 --- a/gator.js +++ b/gator.js @@ -362,5 +362,7 @@ module.exports = Gator; } - window.Gator = Gator; + if(window) { + window.Gator = Gator; + } }) (); From 99c41e1d45772a3b4ed07c34405f6f9f8e6444f0 Mon Sep 17 00:00:00 2001 From: Martti Laine Date: Thu, 27 Oct 2016 00:19:02 +0300 Subject: [PATCH 2/2] Follow code style --- gator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gator.js b/gator.js index fce905f..cdb2307 100644 --- a/gator.js +++ b/gator.js @@ -362,7 +362,7 @@ module.exports = Gator; } - if(window) { + if (window) { window.Gator = Gator; } }) ();