]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Fix Style/SafeNavigation rubocop warnings
[rails.git] / app / models / relation.rb
index b17a3b604674abe85e166aeb8da09d34e9fecfc9..42ac3d6dc337ce11633ac4a68765b621b2b51d4d 100644 (file)
@@ -260,7 +260,7 @@ class Relation < ActiveRecord::Base
       element = model.lock("for share").find_by(:id => m[1])
 
       # and check that it is OK to use.
-      raise OSM::APIPreconditionFailedError, "Relation with id #{id} cannot be saved due to #{m[0]} with id #{m[1]}" unless element && element.visible? && element.preconditions_ok?
+      raise OSM::APIPreconditionFailedError, "Relation with id #{id} cannot be saved due to #{m[0]} with id #{m[1]}" unless element&.visible? && element&.preconditions_ok?
 
       hash[m[1]] = true
     end