Skip to content

Commit

Permalink
Merge pull request #455 from zinigor/add/window-check
Browse files Browse the repository at this point in the history
Added a check for window existence before accessing location property.
  • Loading branch information
matthewp authored Jan 22, 2018
2 parents 6a5234d + b92ba14 commit 923f489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions page.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@
*/
function getBase() {
if(!!base) return base;
var loc = pageWindow.location;
return (hashbang && loc.protocol === 'file:') ? loc.pathname : base;
var loc = hasWindow && pageWindow.location;
return (hasWindow && hashbang && loc.protocol === 'file:') ? loc.pathname : base;
}

page.sameOrigin = sameOrigin;
Expand Down

0 comments on commit 923f489

Please sign in to comment.