From e9a2c24280e21e1a1ca3db06771c4458d73b57b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mendiara=20Ca=C3=B1ardo?= Date: Tue, 11 Oct 2016 17:23:34 +0200 Subject: [PATCH] [[FIX]] Check stack in Error instances --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index a2ad9c5..fc7023f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -139,7 +139,7 @@ function formatObject(error) { } function formatStack(error) { - if (error instanceof Error) { + if (error instanceof Error && error.stack != null) { var stack = error.stack; return stack.substring(stack.indexOf('\n') + 1); }