It could happen that name = nil and data not nil (not sure if this is possible). So to avoid errors I could check name and data in the same condition:

if data == nil or name ==nil
				print_error("There were problems to recover the file: #{name}")
				next
end