Skip to content

Commit 5e3817d

Browse files
committed
Merge pull request #27 from mutewinter/empty_domain_fix
Fixing TypeError for domain() on dot-less hostnames
2 parents 357a093 + dc9ff38 commit 5e3817d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/URI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ p.domain = function(v, build) {
863863

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

0 commit comments

Comments
 (0)