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&.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
point.timestamp = Time.parse(reader.read_string).utc
end
when XML::Reader::TYPE_END_ELEMENT
- if reader.name == "trkpt" && point && point.valid?
+ if reader.name == "trkpt" && point&.valid?
point.altitude ||= 0
yield point
@actual_points += 1