X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/37df03a0432c0fcbc1c1b91af741a5cc135bea34..da059269f9e5d63b4029abf0e1b8b90d210dc7c5:/app/models/relation.rb?ds=sidebyside diff --git a/app/models/relation.rb b/app/models/relation.rb index 28fa326ba..e3ba69b56 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -33,6 +33,7 @@ class Relation < ActiveRecord::Base doc.find('//osm/relation').each do |pt| return Relation.from_xml_node(pt, create) end + raise OSM::APIBadXMLError.new("node", xml, "XML doesn't contain an osm/relation element.") rescue LibXML::XML::Error, ArgumentError => ex raise OSM::APIBadXMLError.new("relation", xml, ex.message) end @@ -60,6 +61,8 @@ class Relation < ActiveRecord::Base relation.visible = true pt.find('tag').each do |tag| + raise OSM::APIBadXMLError.new("relation", pt, "tag is missing key") if tag['k'].nil? + raise OSM::APIBadXMLError.new("relation", pt, "tag is missing value") if tag['v'].nil? relation.add_tag_keyval(tag['k'], tag['v']) end