Skip to content

Commit 99643aa

Browse files
committed
ignore postcode areas in countries without postcodes properly
1 parent c05b8f2 commit 99643aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/nominatim_db/tools/postcodes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ def _update_postcode_areas(conn: Connection, analyzer: AbstractAnalyzer,
234234
country_code = cc
235235
fmt = matcher.get_matcher(country_code)
236236
pcs = []
237-
assert fmt is not None
238237

239-
if (m := fmt.match(postcode)):
240-
pcs.append({'out': fmt.normalize(m), 'in': postcode})
238+
if fmt is not None:
239+
if (m := fmt.match(postcode)):
240+
pcs.append({'out': fmt.normalize(m), 'in': postcode})
241241

242242
if country_code is not None and pcs:
243243
_insert_postcode_areas(conn, country_code,

0 commit comments

Comments
 (0)