]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/node.rb
Give a nice error message when parsing the nwr tags and they are missing the k and...
[rails.git] / app / models / node.rb
index eeb6e6da5d0af7e784dd81c175e0d0dc80db3878..dd8d96d12aa2116b56be6e2a3b1d986c3a884f9f 100644 (file)
@@ -105,6 +105,8 @@ class Node < ActiveRecord::Base
     node.visible = true
 
     pt.find('tag').each do |tag|
     node.visible = true
 
     pt.find('tag').each do |tag|
+      raise OSM::APIBadXMLError.new("node", pt, "tag is missing key") if tag['k'].nil?
+      raise OSM::APIBadXMLError.new("node", pt, "tag is missing value") if tag['v'].nil?
       node.add_tag_key_val(tag['k'],tag['v'])
     end
 
       node.add_tag_key_val(tag['k'],tag['v'])
     end