From 50dc706b326af7d2a2e161a6b9f2cce104370c46 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 7 Jan 2020 17:39:39 +0000 Subject: [PATCH] identifier can be 'no value', example: Q26754456 --- depicts/wd_catalog.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/depicts/wd_catalog.py b/depicts/wd_catalog.py index 4c5fe8b..4ece4ea 100644 --- a/depicts/wd_catalog.py +++ b/depicts/wd_catalog.py @@ -163,6 +163,9 @@ def check_catalog(entity, catalog): if property_id == 'P350': continue # RKDimages ID value = wikibase.first_datavalue(entity, property_id) + # identifier can be 'no value', example: Q26754456 + if value is None: + continue detail = lookup(property_id, value) try: html = get_catalog_page(property_id, value) @@ -181,6 +184,9 @@ def get_catalog_from_artwork(entity): catalog_detail = [] for property_id in sorted(catalog_ids): value = wikibase.first_datavalue(entity, property_id) + # identifier can be 'no value', example: Q26754456 + if value is None: + continue detail = lookup(property_id, value) catalog_detail.append(detail)