From 523528874cba7d8b1837cda74fab6e089d57c33c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 9 Feb 2022 22:26:24 -0500 Subject: fix(commandError): check description length in _generateErrorEmbed --- src/listeners/commands/commandError.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/listeners/commands/commandError.ts b/src/listeners/commands/commandError.ts index ba27706..78bb165 100644 --- a/src/listeners/commands/commandError.ts +++ b/src/listeners/commands/commandError.ts @@ -143,9 +143,8 @@ export default class CommandErrorListener extends BushListener { description.push(...options.haste); - embed - .addField({ name: 'Stack Trace', value: options.stack.substring(0, 1024) }) - .setDescription(description.join('\n').substring(0, 4000)); + embed.addField({ name: 'Stack Trace', value: options.stack.substring(0, 1024) }); + if (description.length) embed.setDescription(description.join('\n').substring(0, 4000)); if (options.type === 'command-dev' || options.type === 'command-log') embed.setTitle(`${options.isSlash ? 'Slash ' : ''}CommandError #\`${options.errorNum}\``); -- cgit