fix minor metadata fetch issue
This commit is contained in:
parent
aafe27d551
commit
bc98cc6eaa
5
index.js
5
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) {
|
||||
|
|
Loading…
Reference in New Issue