]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/way.rb
mini fix
[rails.git] / app / models / way.rb
index 4143291c1f47eda44189fe803b855edd3e616612..be6531def4bdeac9b71debd94105282e4379fc93 100644 (file)
@@ -113,7 +113,7 @@ class Way < ActiveRecord::Base
         end
       else
         # otherwise, manually go to the db to check things
-        if nd.node.visible? and nd.node.visible?
+        if nd.node and nd.node.visible?
           ordered_nodes[nd.sequence_id] = nd.node_id.to_s
         end
       end
@@ -274,7 +274,7 @@ class Way < ActiveRecord::Base
     check_consistency(self, new_way, user)
     if self.visible
       if RelationMember.find(:first, :joins => "INNER JOIN current_relations ON current_relations.id=current_relation_members.id",
-                             :conditions => [ "visible = 1 AND member_type='way' and member_id=? ", self.id])
+                             :conditions => [ "visible = ? AND member_type='way' and member_id=? ", true, self.id])
         raise OSM::APIPreconditionFailedError
       else
         self.changeset_id = new_way.changeset_id