diff options
author | Rebecca Turner <me@re-becca.org> | 2016-06-21 00:18:30 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-06-21 01:55:30 +0300 |
commit | 6a33b2c13f637a41e25cd0339925bc430b50358a (patch) | |
tree | 37df0f4e77ec397abc0483500b48f011cb2d37d9 /lib/outdated.js | |
parent | fbefb8675b26320b295f481b4872ce99f0180807 (diff) |
outdated: Ensure errors reading the package tree do not crash
Fixes: #13115
Credit: @iarna
Reviewed-By: @othiym23
PR-URL: https://github.com/npm/npm/pull/13121
Diffstat (limited to 'lib/outdated.js')
-rw-r--r-- | lib/outdated.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index 474e3d9a1..dd5979836 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -76,6 +76,7 @@ function outdated (args, silent, cb) { if (npm.config.get('depth') === Infinity) npm.config.set('depth', 0) readPackageTree(dir, andRecalculateMetadata(function (er, tree) { + if (!tree) return cb(er) mutateIntoLogicalTree(tree) outdated_(args, '', tree, {}, 0, function (er, list) { list = uniq(list || []).sort(function (aa, bb) { |