mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
(stackparser) add null check
This commit is contained in:
parent
9ad13a1a86
commit
a86277aeb3
@ -100,11 +100,13 @@ StackTraceParser.prototype.parse = function (stack) {
|
||||
|
||||
for (var i = 0, len = stack.length; i < len; i++) {
|
||||
var callsite = stack[i];
|
||||
// avoid null values
|
||||
if (!callsite.file_name || !callsite.line_number) continue;
|
||||
var type = (!path.isAbsolute(callsite.file_name) && callsite.file_name[0] !== '.') ? 'core' : 'user'
|
||||
|
||||
// only use the callsite if its inside user space
|
||||
if (!callsite || type === 'core' || callsite.file_name.indexOf('node_modules') > -1 || callsite.file_name.indexOf('vxx') > -1)
|
||||
continue ;
|
||||
continue;
|
||||
|
||||
// get the whole context (all lines) and cache them if necessary
|
||||
var context = self._cache.get(callsite.file_name)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user