From 60a5d7d23d8ad1648db68d6bc39e29aabf7d35e4 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 3 Apr 2024 18:08:50 -0400 Subject: [PATCH] Fix --- commands/search/magic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/search/magic.js b/commands/search/magic.js index d4d97175..9b8437b6 100644 --- a/commands/search/magic.js +++ b/commands/search/magic.js @@ -75,7 +75,7 @@ module.exports = class MagicCommand extends Command { const { body } = await request .get('https://api.scryfall.com/cards/search') .query({ q: `${query}${isFunny ? ' is:funny' : ''}` }); - if (body.status === 404) return null; + if (!body.data || !body.data.length || body.status === 404) return null; return body.data[0]; } catch (err) { if (err.status === 404) return null;