bug fix
@@ -336,11 +336,6 @@ func readRowsFromSheet(Worksheet *xlsxWorksheet, file *File) ([]*Row, int, int)
}
rows[y] = row
- for i := 0; i < len(rows); i++ {
- if rows[i] == nil {
- rows[i] = new(Row)
- }
return rows, maxCol, maxRow
@@ -96,7 +96,7 @@ type xlsxC struct {
// get cell
func (sh *Sheet) Cell(row, col int) *Cell {
- if len(sh.Rows) > row && len(sh.Rows[row].Cells) > col {
+ if len(sh.Rows) > row && sh.Rows[row] != nil && len(sh.Rows[row].Cells) > col {
return sh.Rows[row].Cells[col]
return new(Cell)