summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
Diffstat (limited to 'col.go')
-rw-r--r--col.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/col.go b/col.go
index f51336d..c0deb58 100644
--- a/col.go
+++ b/col.go
@@ -415,6 +415,13 @@ func (f *File) SetColStyle(sheet, columns string, styleID int) error {
if err != nil {
return err
}
+ s := f.stylesReader()
+ s.Lock()
+ if styleID < 0 || s.CellXfs == nil || len(s.CellXfs.Xf) <= styleID {
+ s.Unlock()
+ return newInvalidStyleID(styleID)
+ }
+ s.Unlock()
ws, err := f.workSheetReader(sheet)
if err != nil {
return err