Skip to content

Commit

Permalink
Throw 'Invalid Version' for non-string versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Smillie committed May 2, 2014
1 parent b537e13 commit c5ea241
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions semver.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ function SemVer(version, loose) {
return version;
else
version = version.version;
} else if (typeof version !== 'string') {
throw new TypeError('Invalid Version: ' + version);
}

if (!(this instanceof SemVer))
Expand Down

0 comments on commit c5ea241

Please sign in to comment.