From c8fb87dc707061f8fc9ae21bfd01970e5d69b44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Gro=C3=9F?= Date: Wed, 21 Sep 2022 13:41:56 +0200 Subject: [PATCH] View: Handle empty or invalid card IDs. Fixes #24 --- commands/view.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/view.js b/commands/view.js index 103341f..93f7946 100644 --- a/commands/view.js +++ b/commands/view.js @@ -54,7 +54,10 @@ module.exports = { { model: User} ] }); - + if (card === null) { + interaction.editReply({ content: "Card not found" }); + return; + } let cardImage = await Rendering.renderCard(card); //get base filename let filename = cardImage.split("/").pop();