aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csv
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2020-05-17 11:51:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-20 02:32:50 +0900
commitb8084b5cb4e20d463938b518dd12f91290c3fb1a (patch)
treeee40d00a219ef8eb92a4194f9697902276a629b3 /lib/csv
parent5359121a56e90bd4b42a6638046ca34ea72dee8d (diff)
downloadruby-b8084b5cb4e20d463938b518dd12f91290c3fb1a.tar.gz
[ruby/csv] Fix a bug that write_nil_value or write_empty_value don't work with non String
GitHub: fix GH-123 Reported by asm256. Thanks!!! https://github.com/ruby/csv/commit/b4492139be
Diffstat (limited to 'lib/csv')
-rw-r--r--lib/csv/fields_converter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv/fields_converter.rb b/lib/csv/fields_converter.rb
index a751c9ea1d..178ffb37bc 100644
--- a/lib/csv/fields_converter.rb
+++ b/lib/csv/fields_converter.rb
@@ -50,7 +50,7 @@ class CSV
fields.collect.with_index do |field, index|
if field.nil?
field = @nil_value
- elsif field.empty?
+ elsif field.is_a?(String) and field.empty?
field = @empty_value unless @empty_value_is_empty_string
end
@converters.each do |converter|