Skip to content

Commit f49e256

Browse files
committed
Don't blindly read map indexes that may be unset
1 parent b8e1113 commit f49e256

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

widget/table.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (t *Table) SetColumnWidth(id int, width float32) {
308308
t.columnWidths = make(map[int]float32)
309309
}
310310

311-
if t.columnWidths[id] == width {
311+
if set, ok := t.columnWidths[id]; ok && set == width {
312312
t.propertyLock.Unlock()
313313
return
314314
}
@@ -337,7 +337,7 @@ func (t *Table) SetRowHeight(id int, height float32) {
337337
t.rowHeights = make(map[int]float32)
338338
}
339339

340-
if t.rowHeights[id] == height {
340+
if set, ok := t.rowHeights[id]; ok && set == height {
341341
t.propertyLock.Unlock()
342342
return
343343
}

0 commit comments

Comments
 (0)