From: Tareq Al-Ahdal Date: Fri, 25 Mar 2022 14:25:55 +0000 (+0800) Subject: fix edge case handling when 'names' is not there X-Git-Tag: v4.1.0~64^2~7 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/afef83b1c61dc182d1bd46d6e0638d62a653bd26 fix edge case handling when 'names' is not there --- 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.