Skip to content

Commit

Permalink
Validate stack existence when logging Error instances. Fixes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Schiavone authored and klaudiosinani committed Jun 7, 2018
1 parent dd06050 commit b45d5b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion signale.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Signale {
}
}

if (msg instanceof Error) {
if (msg instanceof Error && msg.stack) {
const [name, ...rest] = msg.stack.split('\n');
if (this._config.underlineMessage) {
signale.push(chalk.underline(name));
Expand Down

0 comments on commit b45d5b4

Please sign in to comment.