aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csv.rb')
-rw-r--r--lib/csv.rb4
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)