From 49425323561b542f4dbe6430e977a68caa12235d Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Thu, 28 Nov 2024 12:22:41 +0100 Subject: [PATCH] Coping with incomplete data --- oarepo_doi/doi_mapping_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oarepo_doi/doi_mapping_base.py b/oarepo_doi/doi_mapping_base.py index d082c31..914d27d 100644 --- a/oarepo_doi/doi_mapping_base.py +++ b/oarepo_doi/doi_mapping_base.py @@ -20,8 +20,8 @@ def get_doi(self, record): object_identifiers = record["metadata"].get("objectIdentifiers", []) doi = None for id in object_identifiers: - if id["scheme"] == "DOI": - doi = id["identifier"] + if id.get("scheme") == "DOI": + doi = id.get("identifier") return doi def add_doi(self, record, data, doi_value):