mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Geography: Fix crash in nominatim.py when some results are not OSM objects
This commit is contained in:
parent
162e974aba
commit
696d82ccfe
@ -31,8 +31,6 @@
|
||||
|
||||
import json
|
||||
import time
|
||||
import string
|
||||
import datetime
|
||||
import threading
|
||||
import urllib.parse
|
||||
|
||||
@ -77,4 +75,4 @@ def search_osmids(query):
|
||||
on the query format"""
|
||||
data = _query_nominatim("/search", {"format": "json", "q": query})
|
||||
|
||||
return [item["osm_id"] for item in data]
|
||||
return [item["osm_id"] for item in data if item.get("osm_id")]
|
||||
|
@ -114,5 +114,4 @@ class GeographyNominatimTestCase(SupyTestCase):
|
||||
self.assertEqual(results[0], 450381, results)
|
||||
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||
|
Loading…
Reference in New Issue
Block a user