Kylart / MalScraper

Scrape everything you can from MyAnimeList.net
MIT License
178 stars 49 forks source link

Error pagination #29

Closed kaiserdj closed 4 years ago

kaiserdj commented 4 years ago

Returns an error when trying to paginate an advanced search, which doesn't have as many elements Code:

malScraper.search.search("anime", {
                "term": "12-sai.: Kiss, Kirai, Suki",
                "type": 2,
                "has": 50
            }).then((data) => console.log(data)).
                catch((err) => console.log(err));

Error:

TypeError: Cannot read property 'length' of null
    at hasNext (c:\Users\gonfe\Documents\GitHub\pruebas\node_modules\mal-scraper\src\search\index.js:145:27)
    at c:\Users\gonfe\Documents\GitHub\pruebas\node_modules\mal-scraper\src\search\index.js:163:22
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Kylart commented 4 years ago

Maybe this is related to #28 . I just tried and it works 🤔