From 811a18ef7609d49d97aba3d61d359da979100246 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 11 Jun 2021 22:26:28 +0200 Subject: datacite: more careful title string access; fixes sentry #88350 Caused by a partial "title entry without title" coming *first* (e.g. just holding, e.g. a language, like: {'lang': 'da'} --- python/fatcat_tools/importers/datacite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py index 221ac8f5..703dbc27 100644 --- a/python/fatcat_tools/importers/datacite.py +++ b/python/fatcat_tools/importers/datacite.py @@ -1088,7 +1088,7 @@ def parse_datacite_titles(titles): for entry in titles: if not title and ('titleType' not in entry or not entry.get('titleType')): - title = entry.get('title').strip() + title = (entry.get('title') or '').strip() if not subtitle and entry.get('titleType') == 'Subtitle': subtitle = entry.get('title', '').strip() if not original_language_title: -- cgit v1.2.3