From afef83b1c61dc182d1bd46d6e0638d62a653bd26 Mon Sep 17 00:00:00 2001 From: Tareq Al-Ahdal Date: Fri, 25 Mar 2022 22:25:55 +0800 Subject: [PATCH 1/1] fix edge case handling when 'names' is not there --- nominatim/tools/country_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nominatim/tools/country_info.py b/nominatim/tools/country_info.py index ef79a55a..18266cce 100644 --- a/nominatim/tools/country_info.py +++ b/nominatim/tools/country_info.py @@ -35,8 +35,8 @@ class _CountryInfo: elif not isinstance(prop['languages'], list): prop['languages'] = [x.strip() for x in prop['languages'].split(',')] - if 'names' not in prop: - prop['names'][self._key_prefix] = {} + if 'names' not in prop or prop['names'] is None: + prop['names'] = {self._key_prefix: {}} def items(self): """ Return tuples of (country_code, property dict) as iterable. -- 2.39.5