Skip to content

Commit

Permalink
install: don't crash if node.requiredBy is missing.
Browse files Browse the repository at this point in the history
If a package has malformed metadata, this field is sometimes missing.

PR-URL: npm/npm#13519
Credit: @creationix
Reviewed-By: @iarna
  • Loading branch information
creationix authored and iarna committed Oct 20, 2016
1 parent a55bd65 commit a40b32d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/mutate-into-logical-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var mutateIntoLogicalTree = module.exports = function (tree) {

Object.keys(flat).sort().forEach(function (flatname) {
var node = flat[flatname]
if (!node.requiredBy.length) return
if (!(node.requiredBy && node.requiredBy.length)) return

if (node.parent) {
// If a node is a cycle that never reaches the root of the logical
Expand Down

0 comments on commit a40b32d

Please sign in to comment.