X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e4d7b3ee6631e1c5aee23ebe52adb32c716f5cbd..6ba75a3bb02dfa7ccb4ba8ec093e850969f953bb:/app/models/node.rb diff --git a/app/models/node.rb b/app/models/node.rb index eeb6e6da5..df6442b83 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -70,6 +70,7 @@ class Node < ActiveRecord::Base doc.find('//osm/node').each do |pt| return Node.from_xml_node(pt, create) end + raise OSM::APIBadXMLError.new("node", xml, "XML doesn't contain an osm/node element.") rescue LibXML::XML::Error, ArgumentError => ex raise OSM::APIBadXMLError.new("node", xml, ex.message) end @@ -105,6 +106,8 @@ class Node < ActiveRecord::Base 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