From 73acb30e982ae5a1e815a448e742d832067a1bdd Mon Sep 17 00:00:00 2001 From: Rae Knowler Date: Wed, 24 May 2023 11:17:36 +0200 Subject: [PATCH] fix: Don't crash when given an invalid identifier --- ckanext/dcatapchharvest/profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ckanext/dcatapchharvest/profiles.py b/ckanext/dcatapchharvest/profiles.py index 0ac72a4..530b388 100644 --- a/ckanext/dcatapchharvest/profiles.py +++ b/ckanext/dcatapchharvest/profiles.py @@ -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):