From a86277aeb3bc29fa1feeb44bb2d6128273fb0e2f Mon Sep 17 00:00:00 2001 From: vmarchaud Date: Wed, 29 Mar 2017 15:36:50 +0200 Subject: [PATCH] (stackparser) add null check --- lib/Interactor/Utility.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Interactor/Utility.js b/lib/Interactor/Utility.js index b7537c5a..c64da7ef 100644 --- a/lib/Interactor/Utility.js +++ b/lib/Interactor/Utility.js @@ -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)