diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-25 16:41:40 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-25 16:41:40 +0000 |
commit | 0aa197c6f2740ba9ed5e543737965164a356781e (patch) | |
tree | ccdaf199f893ed8b66ca2f0c400c954aa09a8448 /lib/csv.rb | |
parent | c8660d896698e31a62ad9c149213e315a70a1035 (diff) | |
download | ruby-0aa197c6f2740ba9ed5e543737965164a356781e.tar.gz |
* lib/csv.rb: Reject nil as data source for CSV.new, patch by @Peeja.
[Fixes GH-580] https://github.com/ruby/ruby/pull/580
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r-- | lib/csv.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index cd59d8caeb..595586a541 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -1484,6 +1484,10 @@ class CSV # so be sure to set what you want here. # def initialize(data, options = Hash.new) + if data.nil? + raise ArgumentError.new("Cannot parse nil as CSV") + end + # build the options for this read/write options = DEFAULT_OPTIONS.merge(options) |