Skip to content

Commit

Permalink
Merge pull request #27 from mutewinter/empty_domain_fix
Browse files Browse the repository at this point in the history
Fixing TypeError for domain() on dot-less hostnames
  • Loading branch information
rodneyrehm committed May 19, 2012
2 parents 357a093 + dc9ff38 commit 5e3817d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/URI.js
Expand Up @@ -863,7 +863,7 @@ p.domain = function(v, build) {

// if hostname consists of 1 or 2 segments, it must be the domain
var t = this._parts.hostname.match(/\./g);
if (t.length < 2) {
if (t && t.length < 2) {
return this._parts.hostname;
}

Expand Down

0 comments on commit 5e3817d

Please sign in to comment.