You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Mangadex API has been returning 'null' results when calling Chapter.search(), which causes a TypeError (Cannot read property 'id' of null) in the Chapter constructor.
Exception has occurred: TypeError: Cannot read property 'id' of null
at new Chapter (mangadex-full-api\src\structure\chapter.js:30:32)
at mangadex-full-api\src\util.js:211:28
at Array.map (<anonymous>)
at Object.apiCastedRequest (mangadex-full-api\src\util.js:211:16)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at main (/src/sandbox.ts:48:19)
Reproduction is hazy since its a particular set of chapters, but just opening an issue in case we can improve robustness on the package level anyway:
I assume the problem is that the conditional that checks the MD API data is ignoring the null response since it's not falsy, but I can't examine why it's happening without more info.
Sadly I couldn't find more info on what those particular chapters were in order to have a concrete reproduction, but I can assist in immitating a similar return result from apiSearchRequest()
new Chapter({ data: null });
I think your guess is spot on - I didn't understand your intention with that line so I didn't try and fix it but switching the check to == null or whatever flavour of test you prefer should fix it.
The Mangadex API has been returning 'null' results when calling Chapter.search(), which causes a TypeError (
Cannot read property 'id' of null
) in the Chapter constructor.Reproduction is hazy since its a particular set of chapters, but just opening an issue in case we can improve robustness on the package level anyway:
The text was updated successfully, but these errors were encountered: