Permalink
Browse files

link: do not allow linking unnamed packages

  • Loading branch information...
1 parent caa7065 commit 401a64286aa6665a94d1d2f13604f7014c5fce87 @isaacs isaacs committed Feb 15, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/link.js
View
@@ -121,6 +121,10 @@ function linkPkg (folder, cb_) {
return cb_(er, [[d && d._id, target, null, null]])
}
if (er) return cb(er)
+ if (!d.name) {
+ er = new Error("Package must have a name field to be linked")
+ return cb(er)
+ }
var target = path.resolve(npm.globalDir, d.name)
rm(target, function (er) {
if (er) return cb(er)

0 comments on commit 401a642

Please sign in to comment.