From 8295bb0a4e000cf99b0b1684cf381737bf9b42af Mon Sep 17 00:00:00 2001 From: James Lee Date: Sun, 16 Oct 2011 00:18:30 +0000 Subject: [PATCH] fix a nil.gsub() bug git-svn-id: file:///home/svn/framework3/trunk@13943 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/ui/text/table.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rex/ui/text/table.rb b/lib/rex/ui/text/table.rb index ee0ed24a50..8ba842a7e9 100644 --- a/lib/rex/ui/text/table.rb +++ b/lib/rex/ui/text/table.rb @@ -121,7 +121,11 @@ class Table rows.each { |row| next if is_hr(row) str << ( row.map{|x| - x.gsub(/[\r\n]/, ' ').gsub(/\s+/, ' ').gsub('"', '""') + if x.nil? + "" + else + x.gsub(/[\r\n]/, ' ').gsub(/\s+/, ' ').gsub('"', '""') + end }.map{|x| "\"#{x}\"" }.join(",") + "\n" ) } str