Closed FriendOfTheNight closed 6 years ago
Can you please provide a article this is happening on?
Here is a page that's causing it: https://en.wikipedia.org/wiki/Java_Classloader
I just took it out to recreate and the exact error is "TypeError: Cannot read property 'imageinfo' of undefined."
As far as I can tell it's happening for any article with no image. I'm searching for pages with wiki().search, then iterating over the page titles and getting the page with wiki().page, then calling page.mainImage on the page.
let pages = await wiki().search(searchQuery, numResults);
...
var page = await wiki().page(pages[i]);
var image = await page.mainImage();
...
Let me know if you need any more info.
Thanks, Brian
Good find. v4.5.2 has the fix.
Getting several errors from page.mainImage function (trying to access imageinfo on undefined). I unminified and added a check to fix for now.![npe-fix](https://user-images.githubusercontent.com/9436937/36124960-18e0fdda-1020-11e8-8897-9b4a5cf9cb9a.jpg)