Skip to content

Commit

Permalink
make location accessors not NPE when doc.loc not set
Browse files Browse the repository at this point in the history
qunit wants to look at the location to see if the doc is local or remote (though it doesn't currently use this). But envjs errors out if you ask for fields; make it return nothing
  • Loading branch information
smparkes committed Oct 16, 2009
1 parent ed73c2a commit cf6278f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/window/location.js
Expand Up @@ -90,7 +90,7 @@ $w.__defineGetter__("location", function(url){
this.search + this.hash;
},
get protocol(){
return protocol.exec(this.href)[0];
return this.href && protocol.exec(this.href)[0];
},
set protocol(_protocol){
$w.location = _protocol + this.host + this.pathname +
Expand Down

0 comments on commit cf6278f

Please sign in to comment.