From 4c7e6e0f5985b676d6fd3c02d89d8a00bcd4df39 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Fri, 27 Jan 2017 13:50:20 +0530 Subject: [PATCH] refactor(youch): add conditional before looping over frames frames can be undefined at times, so it is required to make sure frames is a valid array before mapping over them --- src/Youch/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Youch/index.js b/src/Youch/index.js index 146637b..078d455 100644 --- a/src/Youch/index.js +++ b/src/Youch/index.js @@ -129,7 +129,7 @@ class Youch { message: this.error.message, name: this.error.name, status: this.error.status, - frames: stack.frames.map(callback) + frames: stack.frames instanceof Array === true ? stack.frames.map(callback) : [] } }