summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/rows.go b/rows.go
index 6360f4e..229b12d 100644
--- a/rows.go
+++ b/rows.go
@@ -195,9 +195,12 @@ func (f *File) Rows(sheet string) (*Rows, error) {
if !ok {
return nil, ErrSheetNotExist{sheet}
}
- if f.Sheet[name] != nil {
+ if ws, ok := f.Sheet.Load(name); ok && ws != nil {
+ worksheet := ws.(*xlsxWorksheet)
+ worksheet.Lock()
+ defer worksheet.Unlock()
// flush data
- output, _ := xml.Marshal(f.Sheet[name])
+ output, _ := xml.Marshal(worksheet)
f.saveFileList(name, f.replaceNameSpaceBytes(name, output))
}
var (