Skip to content

Commit

Permalink
Fix checking of window global variable in strict mode
Browse files Browse the repository at this point in the history
Previous version of the check failed in strict mode with error
"window is not defined". Strict mode is default in Webpack.
  • Loading branch information
lutovich committed Sep 27, 2018
1 parent 9424ed5 commit 1fe6026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/v1/internal/browser/browser-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,5 @@ function verifyEncryptionSettings(encryptionOn, encryptionOff, secureProtocol) {
}

function detectWebPageProtocol() {
return window && window.location ? window.location.protocol : null;
return typeof window != 'undefined' && window.location ? window.location.protocol : null;
}

0 comments on commit 1fe6026

Please sign in to comment.