diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2020-11-10 17:08:27 +0100 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2020-11-10 17:08:27 +0100 |
commit | 18ea5e372cdb0873cffebef67ea80abe01bcf138 (patch) | |
tree | 4fbe69ce1fbdeaa3f6d7bb5f310fa336a5da69cc | |
parent | GroupBox: Fix size calculation and do some cleanup (diff) | |
download | wireguard-windows-18ea5e372cdb0873cffebef67ea80abe01bcf138.tar.xz wireguard-windows-18ea5e372cdb0873cffebef67ea80abe01bcf138.zip |
declarative/TableView: Guard against invalid index, fixes #740
-rw-r--r-- | declarative/tableview.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/declarative/tableview.go b/declarative/tableview.go index dd886655..560330ac 100644 --- a/declarative/tableview.go +++ b/declarative/tableview.go @@ -81,8 +81,10 @@ func (tvs *tvStyler) StyleCell(style *walk.CellStyle) { tvs.dflt.StyleCell(style) } - if styleCell := tvs.colStyleCellFuncs[style.Col()]; styleCell != nil { - styleCell(style) + if col := style.Col(); col >= 0 { + if styleCell := tvs.colStyleCellFuncs[col]; styleCell != nil { + styleCell(style) + } } } |