From b8084b5cb4e20d463938b518dd12f91290c3fb1a Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 17 May 2020 11:51:06 +0900 Subject: [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 --- lib/csv/fields_converter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/csv') 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| -- cgit v1.2.3