From ba63a92de021193c90794c54fefae39d806fba4a Mon Sep 17 00:00:00 2001 From: Craig Date: Tue, 28 Jun 2016 14:30:57 -0700 Subject: [PATCH] fix(util): check stack exists before filtering the stack trace (#3309) closes #3224 --- lib/util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util.ts b/lib/util.ts index 3887f8b26..eb45f0e75 100644 --- a/lib/util.ts +++ b/lib/util.ts @@ -49,7 +49,9 @@ export function runFilenameOrFn_( } if (typeof filenameOrFn === 'function') { let results = when(filenameOrFn.apply(null, args), null, (err) => { - err.stack = exports.filterStackTrace(err.stack); + if (err.stack) { + err.stack = exports.filterStackTrace(err.stack); + } throw err; }); resolvePromise(results);