diff options
author | Sutou Kouhei <[email protected]> | 2020-05-17 11:51:06 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-07-20 02:32:50 +0900 |
commit | b8084b5cb4e20d463938b518dd12f91290c3fb1a (patch) | |
tree | ee40d00a219ef8eb92a4194f9697902276a629b3 /lib/csv/fields_converter.rb | |
parent | 5359121a56e90bd4b42a6638046ca34ea72dee8d (diff) |
[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
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3332
Diffstat (limited to 'lib/csv/fields_converter.rb')
-rw-r--r-- | lib/csv/fields_converter.rb | 2 |
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| |