diff options
| author | Randy Morgan <[email protected]> | 2012-01-13 18:56:38 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-01-13 18:56:38 +0900 |
| commit | c3459ef98ee4ede887d28dfacd1c0d62e0cddd29 (patch) | |
| tree | 17c04ff769676454f2d9ec40e1e615a63191014d /lib | |
| parent | c16ba34f2165712f37470d127039beb8343f8cfe (diff) | |
| download | caxlsx-c3459ef98ee4ede887d28dfacd1c0d62e0cddd29.tar.gz caxlsx-c3459ef98ee4ede887d28dfacd1c0d62e0cddd29.zip | |
applying col_style to a list of rows of unequal length can cause an error as there is no cell at the index.
for example, with a structure like this:
********
**
********
***
col_style 2, 1
would fail as the second row has no cell at index 2.
Thanks Don!
https://github.com/randym/axlsx/issues/15
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/worksheet.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 41d0f841..8b0f8bfa 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -195,6 +195,7 @@ module Axlsx offset = options.delete(:row_offset) || 0 @rows[(offset..-1)].each do |r| cells = r.cells[index] + next unless cells if cells.is_a?(Array) cells.each { |c| c.style = style } else |
