Skip to content

Commit

Permalink
refactor(youch): add conditional before looping over frames
Browse files Browse the repository at this point in the history
frames can be undefined at times, so it is required to make sure frames is a valid array before

mapping over them
  • Loading branch information
thetutlage committed Jan 27, 2017
1 parent fb8df29 commit 4c7e6e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Youch/index.js
Expand Up @@ -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) : []
}
}

Expand Down

0 comments on commit 4c7e6e0

Please sign in to comment.