lib/roo/excel.rb in roo-0.2.5 vs lib/roo/excel.rb in roo-0.2.6
- old
+ new
@@ -45,10 +45,11 @@
return nil
end
cell = row_par.at(col-1)
# p "celltype: "
# p cell.type
+ return nil unless cell
case cell.type
when :numeric then return cell.to_i
when :text then return cell.to_s('latin1')
when :date then return cell.date
else
@@ -65,9 +66,10 @@
skip = 0
line = 1
worksheet.each(skip) { |row_par|
if line == row
cell = row_par.at(col-1)
+ return nil unless cell
case cell.type
when :numeric then return "float"
when :text then return "string"
when :date then return "date"
else return cell.type