Skip to content

Commit

Permalink
Fix versions.find: Correctly return error instead of 0.0.0
Browse files Browse the repository at this point in the history
... if `latest` was passed and list was `[]` it would
result in 0.0.0 being returned without an error
  • Loading branch information
marcelklehr committed Dec 8, 2015
1 parent db1e76d commit 0dc750e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ versions.find = function(versionSpec, list, cb){
}
if(v && !semver.satisfies(v.substr('nodev'.length), versionSpec)) v = null;
}
if(!v)
if(!v || v === '0.0.0')
return cb(new Error('Version spec, "' +
versionSpec + '", didn\'t match any available version'));
cb(null, v);
Expand Down

0 comments on commit 0dc750e

Please sign in to comment.