diff options
author | Emily Marigold Klassen <forivall@gmail.com> | 2017-06-08 02:35:24 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-06-08 03:41:10 +0300 |
commit | e7e8ee5c57c7238655677e118a8809b652019f53 (patch) | |
tree | c1c73ac4ff8e617cfbd2a1e5ea76dd54ed0749b4 | |
parent | 35316cce2ca2d8eb94161ec7fe7e8f7bec7b3aa7 (diff) |
shrinkwrap: quick fix for possibility that req is sometimes null (#16937)
PR-URL: https://github.com/npm/npm/pull/16937
Credit: @forivall
Reviewed-By: @forivall
-rw-r--r-- | lib/shrinkwrap.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/shrinkwrap.js b/lib/shrinkwrap.js index 428c12bba..48c324863 100644 --- a/lib/shrinkwrap.js +++ b/lib/shrinkwrap.js @@ -107,7 +107,7 @@ function shrinkwrapDeps (deps, top, tree, seen) { return } var pkginfo = deps[moduleName(child)] = {} - var req = child.package._requested || getRequested(child) + var req = child.package._requested || getRequested(child) || {} if (req.type === 'directory' || req.type === 'file') { pkginfo.version = 'file:' + path.relative(top.path, child.package._resolved || req.fetchSpec) } else if (!req.registry && !child.fromBundle) { |