fix: no search result edge case

This commit is contained in:
TrèsAbhi authored and GitHub committed 2023-04-20 18:03:16 -05:00
1 parent bc5654619b
commit 74ce8b23eb
1 file changed
+1 -1
+1 -1
View File
@@ -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`,