randym/axlsx — Issue #15: Bug handling an empty row
Author: dkmdnielsen
Created: 2012-01-12 19:41:44+00:00
State: open

this in in Worksheet.Col_Style. If a row is completely empty (no cells assigned), then @list = nil in SimpleTypedList. When the col_style routine executes, the statement "cells = r.cells[index]" results in cells being nil. The very next if clause crashes. I think an enclosing "unless cells.nil?" is required around the if clause.

```ruby
def col_style(index, style, options={})
offset = options.delete(:row_offset) || 0
@rows[(offset..-1)].each do |r|
cells = r.cells[index]
if cells.is_a?(Array)
cells.each { |c| c.style = style }
else
cells.style = style
end
end
end
```

The logic leading into the above is as follows:

```ruby
@col_integer = s.add_style(:format_code=>' #,###,###') #@col_integer is six
...
ws.col_style 1,@col_integer #set col 'b' format
```