From 74ce8b23eb61c09349e72cbb79f3072e7e2f41d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:03:16 -0500 Subject: [PATCH] fix: no search result edge case --- src/commands/verify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/verify.ts b/src/commands/verify.ts index a9e679e9a..67311ed11 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -20,7 +20,7 @@ export async function execute( `https://api.wotblitz.${server}/wotb/account/list/?application_id=${process.env.WARGAMING_APPLICATION_ID}&search=${ign}`, ).then((response) => response.json())) as AccountList; - if (players?.data?.[0].nickname === ign) { + if (players?.data?.[0]?.nickname === ign) { // good match const clanData = (await fetch( `https://api.wotblitz.${server}/wotb/clans/accountinfo/?application_id=${process.env.WARGAMING_APPLICATION_ID}&account_id=${players.data[0].account_id}&extra=clan`,