Skip to content

When pulling a category MediaWiki#list fails #93

@delonnewman

Description

@delonnewman

When pulling the category as shown below:

Infoboxer.wikipedia('en').category('Category:Census-designated places in California')

I get the following error: 'block in list': undefined method 'first' for nil:NilClass (NoMethodError)

The stack trace points here:

.map { |raw| Page.new(self, Parser.paragraphs(raw['revisions'].first['*'], traits), raw) }

After doing some digging the issue seems to be that the page data for many of the pages listed in that category don't have a 'revisions' key, hence the error. I don't know enough about the MediaWiki APIs to propose a fix. But, I figured I'd start by reporting the issue here.

Thanks for your work!

Ruby Version: 3.0.4
Infoboxer Version: 0.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions