diff --git a/src/js/overlay.js b/src/js/overlay.js index 9e867f6..1074e15 100644 --- a/src/js/overlay.js +++ b/src/js/overlay.js @@ -201,13 +201,17 @@ async function updatePlayerCard(region, puuid) { } async function checkData(region, puuid) { - const response = await fetch(`${apiUrl}/v1/by-puuid/mmr/${region}/${puuid}`) - const data = await response.json(); - const returnStatus = data.status; - const checkifnull = data.data.currenttier; - - if (returnStatus === 200 && checkifnull !== null) { - await updatePlayerCard(region, puuid); + try { + const response = await fetch(`${apiUrl}/v1/by-puuid/mmr/${region}/${puuid}`) + const data = await response.json(); + const returnStatus = data.status; + const checkifnull = data.data.currenttier; + + if (returnStatus === 200 && checkifnull !== null) { + await updatePlayerCard(region, puuid); + } + } catch (error) { + // pass } await winlose(region, puuid) }