From 4e152d8b7d8e6d93987fec0267fd19e5a3e9bb6f Mon Sep 17 00:00:00 2001 From: damienleroux Date: Wed, 20 Jan 2016 11:42:39 +0100 Subject: [PATCH] Update host.js window can be defined and yet window.location can be undefined: both "window" and "window.location" must be defined to access to "protocol" information --- src/lib/host.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/host.js b/src/lib/host.js index 2a39d8715..cdb2f10e7 100644 --- a/src/lib/host.js +++ b/src/lib/host.js @@ -12,7 +12,7 @@ var startsWithProtocolRE = /^([a-z]+:)?\/\//; var defaultProto = 'http:'; var btoa; -if (typeof window !== 'undefined') { +if (typeof window !== 'undefined' && typeof window.location !== 'undefined') { defaultProto = window.location.protocol; btoa = window.btoa; }