]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Fixed precondition failed message which was trying to dereference nil.
[rails.git] / app / models / relation.rb
index 24b139f0ddd33dbe34ebe85634fabf0904bc48b5..2619a545a31f647b4727a8d14867d9063972b4b4 100644 (file)
@@ -307,16 +307,13 @@ class Relation < ActiveRecord::Base
 
         # and check that it is OK to use.
         unless element and element.visible? and element.preconditions_ok?
-          raise OSM::APIPreconditionFailedError.new("Relation with id #{self.id} cannot be saved due to #{m[0]} with id #{element.id}")
-          return false
+          raise OSM::APIPreconditionFailedError.new("Relation with id #{self.id} cannot be saved due to #{m[0]} with id #{m[1]}")
         end
         hash[m[1]] = true
       end
     end
 
     return true
-  rescue
-    return false
   end
 
   # Temporary method to match interface to nodes