From d35c64c873d7a9e9f9bd6c671e1f23bef9a9e6a7 Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Thu, 16 Nov 2023 17:34:59 +0100 Subject: [PATCH] Handle case where org_info is None --- scraper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scraper.py b/scraper.py index c43fb8ff6..864a474fd 100644 --- a/scraper.py +++ b/scraper.py @@ -28,6 +28,7 @@ def zip_discard_compr(*iterables, sentinel=None): for dataset in iatikit.data().datasets.where(filetype='organisation'): org_infos = orgidfinder.parse_org_file(dataset) for org_info in org_infos: + if org_info is None: continue org_info['org_type'] = guide._org_types.get(org_info['org_type_code']) id_ = quote_plus(org_info['org_id']) with open(Path(f'{output_dir}/data/{id_}.json'), 'w') as f: