Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-06-21 00:18:30 +0300
committerRebecca Turner <me@re-becca.org>2016-06-21 01:55:30 +0300
commit6a33b2c13f637a41e25cd0339925bc430b50358a (patch)
tree37df0f4e77ec397abc0483500b48f011cb2d37d9 /lib/outdated.js
parentfbefb8675b26320b295f481b4872ce99f0180807 (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.js1
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) {