summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/rows.go b/rows.go
index 9269ac6..fdb9374 100644
--- a/rows.go
+++ b/rows.go
@@ -857,7 +857,10 @@ func (f *File) SetRowStyle(sheet string, start, end, styleID int) error {
if end > TotalRows {
return ErrMaxRows
}
- if styleID < 0 {
+ s := f.stylesReader()
+ s.Lock()
+ defer s.Unlock()
+ if styleID < 0 || s.CellXfs == nil || len(s.CellXfs.Xf) <= styleID {
return newInvalidStyleID(styleID)
}
ws, err := f.workSheetReader(sheet)