From 09f6297eed72738491abddecb7c20bfef2a54206 Mon Sep 17 00:00:00 2001 From: Antoine Goutagny <antoine@swaven.com> Date: Fri, 15 Nov 2019 16:03:01 +0100 Subject: [PATCH] Add checking for null when creating `global` object --- papaparse.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/papaparse.js b/papaparse.js index 15d281b..5f0cf28 100755 --- a/papaparse.js +++ b/papaparse.js @@ -37,9 +37,9 @@ License: MIT // but without using `eval` (which is disabled when // using Content Security Policy). - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined' && self !== null) { return self; } + if (typeof window !== 'undefined' && window !== null) { return window; } + if (typeof global !== 'undefined' && global !== null) { return global; } // When running tests none of the above have been defined return {};