Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Commit 699ae39

Browse files
arthurjdamNikhil Thorat
authored andcommitted
Do not check window object for URL parameters if window is not defined (#155)
* if the program is ran under nodejs, do not attempt to get URL properties (checking for window will break * Merge branch 'master' into master * formatting * fixed lint error * Merge branch 'master' into master
1 parent aaae240 commit 699ae39

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/environment.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ const DEEPLEARNJS_FLAGS_PREFIX = 'dljsflags';
139139
function getFeaturesFromURL(): Features {
140140
const features: Features = {};
141141

142+
if(typeof window === 'undefined') {
143+
return features;
144+
}
145+
142146
const urlParams = util.getQueryParams(window.location.search);
143147
if (DEEPLEARNJS_FLAGS_PREFIX in urlParams) {
144148
const urlFlags: {[key: string]: string} = {};

0 commit comments

Comments
 (0)