diff --git a/index.js b/index.js index 499ca71..9f4e06a 100644 --- a/index.js +++ b/index.js @@ -77,6 +77,11 @@ async function fetchLevelData(name, creator, loose = false) { const { statusCode, headers, trailers, body } = await request(`https://history.geometrydash.eu/api/v1/search/level/advanced/?${params.toString()}`); const data = await body.json(); + if (!data.hits) { + console.warn('got fucked up response from gdhistory:', data); + return + } + if (data.hits.length === 0 && !loose) { return await fetchLevelData(name, creator, true); } else if (data.hits.length === 0) {