Skip to content

Commit

Permalink
filter-invalid-actions: check parent is there before checking target
Browse files Browse the repository at this point in the history
if the parent is not available, this would bomb at runtime with the
error,

```
TypeError: Cannot read property 'target' of null
```

PR-URL: npm/npm#11947
Credit: @thefourtheye
  • Loading branch information
thefourtheye authored and iarna committed Mar 17, 2016
1 parent c3edeab commit 473d324
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/filter-invalid-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (top, differences, next) {
while (action = differences.shift()) {
var cmd = action[0]
var pkg = action[1]
if (pkg.isInLink || pkg.parent.target || pkg.parent.isLink) {
if (pkg.isInLink || (pkg.parent && (pkg.parent.target || pkg.parent.isLink))) {
// we want to skip warning if this is a child of another module that we're removing
if (!pkg.parent.removing) {
log.warn('skippingAction', 'Module is inside a symlinked module: not running ' +
Expand Down

0 comments on commit 473d324

Please sign in to comment.