mloesch / sickle

Sickle: OAI-PMH for Humans
Other
106 stars 42 forks source link

Fix 'NoneType' object has no attribute 'getchildren' error. #47

Closed dkinzer closed 3 years ago

dkinzer commented 4 years ago

We're running into an issue where we are trying to harvest an OAI endpoint where one of the records has no metadata and its status is not set to deleted.

The error we get for this record is at iteration time:

AttributeError: 'NoneType' object has no attribute 'getchildren'

This change updates the code so that it skips a record that has no metadata. Thus, the exception is not thrown.

dkinzer commented 4 years ago

Note I did not add a test case because there are already two failing tests in your tests suite given the new test record added to sickle/tests/sample_data/ListRecords.xml