Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
Fixed TypeError (#743)
Browse files Browse the repository at this point in the history
Basically, I found that if you cause/execute an error that is undefined/null, when the bot tries to send err.stack, it will result in a TypeError because err is undefined, and so it can't read the stack property. This is a very simple fix.

You can replicate this error yourself by just trying to execute Promise.reject().
  • Loading branch information
KylesDigitalLab authored Apr 11, 2020
1 parent 04cac6c commit f1a09a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Commands/Shared/eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = async (main, msg, commandData) => {
msg.send({
embed: {
color: 0xFF0000,
description: `\`\`\`js\n${err.stack}\`\`\``,
description: `\`\`\`js\n${err ? err.stack : err}\`\`\``,
footer: {
text: `Execution time: ${process.hrtime(hrstart)[0]}s ${Math.floor(process.hrtime(hrstart)[1] / 1000000)}ms`,
},
Expand Down

0 comments on commit f1a09a2

Please sign in to comment.