Skip to content

Commit

Permalink
Fix bug where a reporting-org does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
markbrough authored Nov 16, 2023
1 parent aab13de commit 178f99d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion orgidfinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def get_text(el, path, default_lang):

def parse_org(organisation):
org_id = organisation.id
reporting_org_id = organisation.etree.find('reporting-org').get('ref')
reporting_org = organisation.etree.find('reporting-org')
if not reporting_org:
return None
reporting_org_id = reporting_org.get('ref')
if not reporting_org_id or org_id != reporting_org_id:
return None

Expand Down

0 comments on commit 178f99d

Please sign in to comment.