Fix server crash when FantLab provider request times out #4410
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run

This commit is contained in:
advplyr 2025-06-17 17:21:21 -05:00
parent 6634ce8fd4
commit 9bf8d7de11

View file

@ -52,9 +52,7 @@ class FantLab {
return []
})
return Promise.all(items.map(async (item) => await this.getWork(item, timeout))).then((resArray) => {
return resArray.filter((res) => res)
})
return Promise.all(items.map(async (item) => await this.getWork(item, timeout))).then((resArray) => resArray.filter(Boolean))
}
/**
@ -83,6 +81,10 @@ class FantLab {
return null
})
if (!bookData) {
return null
}
return this.cleanBookData(bookData, timeout)
}