dijs / infobox-parser

Parse Wikipedia Infoboxes
40 stars 18 forks source link

fix issue #40 #41

Closed xcarol closed 9 months ago

xcarol commented 1 year ago

The page with id: 8239846 has an empty or malformed hlist which throws a "TypeError: Invalid attempt to destructure non-iterable instance" exception.

the destructure in the parse method of hlist let [, elements] = results; assumes results to have content.

Here this condition is checked before, and if so, it returns an empty array.

dijs commented 9 months ago

Can you please add a unit test for this? And I can get it merged in.

xcarol commented 9 months ago

Done :)

dijs commented 9 months ago

Thanks a bunch, and sorry for the late response!

xcarol commented 9 months ago

Thanks a bunch, and sorry for the late response!

No worries. It has been a pleasure! :)