ordered_nodes[nd.sequence_id] = nd.node_id.to_s if visible_nodes[nd.node_id]
else
# otherwise, manually go to the db to check things
- ordered_nodes[nd.sequence_id] = nd.node_id.to_s if nd.node && nd.node.visible?
+ ordered_nodes[nd.sequence_id] = nd.node_id.to_s if nd.node&.visible?
end
end
# to IDs +id_map+.
def fix_placeholders!(id_map, placeholder_id = nil)
nds.map! do |node_id|
- if node_id < 0
+ if node_id.negative?
new_id = id_map[:node][node_id]
raise OSM::APIBadUserInput, "Placeholder node not found for reference #{node_id} in way #{id.nil? ? placeholder_id : id}" if new_id.nil?