Преглед изворни кода

[mod] return empty string on missing osm title

Sometimes openstreetmap returns with None as title. In these cases use an empty
string instead.
Adam Tauber пре 8 година
родитељ
комит
72a217f983
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1
    1
      searx/engines/openstreetmap.py

+ 1
- 1
searx/engines/openstreetmap.py Прегледај датотеку

@@ -43,7 +43,7 @@ def response(resp):
43 43
         if 'display_name' not in r:
44 44
             continue
45 45
 
46
-        title = r['display_name']
46
+        title = r['display_name'] or u''
47 47
         osm_type = r.get('osm_type', r.get('type'))
48 48
         url = result_base_url.format(osm_type=osm_type,
49 49
                                      osm_id=r['osm_id'])