X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6e98e324e58f67b62c6abf343d60ae5e6f22f9eb..e989b1a880f79fd1835a44d16de115a778f890af:/app/models/node.rb diff --git a/app/models/node.rb b/app/models/node.rb index b2650b61d..e90c32950 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -79,11 +79,13 @@ class Node < ActiveRecord::Base def self.from_xml_node(pt, create=false) node = Node.new + raise OSM::APIBadXMLError.new("node", pt, "lat missing") if pt['lat'].nil? + raise OSM::APIBadXMLError.new("node", pt, "lon missing") if pt['lon'].nil? node.lat = pt['lat'].to_f node.lon = pt['lon'].to_f node.changeset_id = pt['changeset'].to_i - return nil unless node.in_world? + raise OSM::APIBadUserInput.new("The node is outside this world") unless node.in_world? # version must be present unless creating return nil unless create or not pt['version'].nil?