[gnome-maps] osmUtils: Don't update a place's name if not in the OSM object
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] osmUtils: Don't update a place's name if not in the OSM object
- Date: Fri, 26 Feb 2016 06:37:24 +0000 (UTC)
commit 757bafb4e0fc7114d24c499ee76db6222f3d4c78
Author: Marcus Lundblad <ml update uu se>
Date: Wed Feb 24 22:27:01 2016 +0100
osmUtils: Don't update a place's name if not in the OSM object
When a place has been edited on OSM don't reset the Place's name attribute
if it's not set in the OSM object, since the PlaceFormatter assumes this
is set. For bare address nodes, this would be set to a value contructed
from the address components, so we shouldn't remove this just because
the OSM object doesn't have a name set.
This fixes stack trace when saving places like that.
https://bugzilla.gnome.org/show_bug.cgi?id=762569
src/osmUtils.js | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/osmUtils.js b/src/osmUtils.js
index 01235aa..91c6b69 100644
--- a/src/osmUtils.js
+++ b/src/osmUtils.js
@@ -47,7 +47,15 @@ function getWikipediaOSMArticleFormatFromUrl(url) {
* Will also update place in the place store.
*/
function updatePlaceFromOSMObject(place, object) {
- place.name = object.get_tag('name');
+ let name = object.get_tag('name');
+
+ if (name) {
+ /* only update the place's name from the OSM object if the OSM object
+ * actually has a name set.
+ * https://bugzilla.gnome.org/show_bug.cgi?id=762569
+ */
+ place.name = name;
+ }
place.population = object.get_tag('population');
place.website = object.get_tag('website');
place.phone = object.get_tag('phone');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]