fix a nil.gsub() bug

git-svn-id: file:///home/svn/framework3/trunk@13943 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2011-10-16 00:18:30 +00:00
parent 5c9ddb293d
commit 8295bb0a4e
1 changed files with 5 additions and 1 deletions

View File

@ -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