Skip to content

Commit ea90379

Browse files
author
Andras Toth
committed
fix(security): don't send dependencies when it's undefined
1 parent d952cce commit ea90379

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/agent/security/security.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ Security.prototype.collectDependencies = function (callback) {
2626
var parsedDependencies
2727
try {
2828
parsedDependencies = JSON.parse(stdout).dependencies
29+
30+
if (!parsedDependencies) {
31+
return callback(new Error('`npm ls --json --production` returned with no dependencies'))
32+
}
2933
} catch (ex) {
3034
return callback(ex)
3135
}
36+
3237
return callback(null, parsedDependencies)
3338
})
3439
}

0 commit comments

Comments
 (0)