From 751c1f1161174da81993830002b970e9ec337a80 Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Tue, 25 Apr 2023 13:30:00 +0200 Subject: [PATCH] fix crash on citation with empty msg (only asset) (#92) Co-authored-by: Mylloon Reviewed-on: https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/pulls/92 --- src/events/message/messageCreate.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/events/message/messageCreate.ts b/src/events/message/messageCreate.ts index 5322979..c147430 100644 --- a/src/events/message/messageCreate.ts +++ b/src/events/message/messageCreate.ts @@ -115,7 +115,10 @@ export default async (message: Message, client: Client) => { } // Description as post content - embed.setDescription(quoted_post?.content ?? ""); + if (quoted_post?.content) { + // Only if content exists and length > 0 + embed.setDescription(quoted_post?.content); + } // Footer let footer = `Posté le ${showDate(