Skip to content

Commit

Permalink
Don't blindly read map indexes that may be unset
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Aug 19, 2024
1 parent b8e1113 commit f49e256
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widget/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (t *Table) SetColumnWidth(id int, width float32) {
t.columnWidths = make(map[int]float32)
}

if t.columnWidths[id] == width {
if set, ok := t.columnWidths[id]; ok && set == width {
t.propertyLock.Unlock()
return
}
Expand Down Expand Up @@ -337,7 +337,7 @@ func (t *Table) SetRowHeight(id int, height float32) {
t.rowHeights = make(map[int]float32)
}

if t.rowHeights[id] == height {
if set, ok := t.rowHeights[id]; ok && set == height {
t.propertyLock.Unlock()
return
}
Expand Down

0 comments on commit f49e256

Please sign in to comment.