Skip to content

Commit

Permalink
Merge pull request #73 from opendata-swiss/fix/improve-stability-with…
Browse files Browse the repository at this point in the history
…-bad-data

fix: Don't crash when given an invalid identifier
  • Loading branch information
bellisk authored Sep 13, 2023
2 parents 58d5de4 + 73acb30 commit dc56b86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckanext/dcatapchharvest/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,10 @@ def parse_dataset(self, dataset_dict, dataset_ref):


def _get_publisher_url_from_identifier(identifier):
return ORGANIZATION_BASE_URL + identifier.split('@')[1]
identifier_split = identifier.split('@')
if len(identifier_split) > 1:
return ORGANIZATION_BASE_URL + identifier_split[1]
return ''


def _get_publisher_dict_from_dataset(publisher):
Expand Down

0 comments on commit dc56b86

Please sign in to comment.