summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlexander Neumann <alexander.neumann@picos-software.com>2020-11-10 17:08:27 +0100
committerAlexander Neumann <alexander.neumann@picos-software.com>2020-11-10 17:08:27 +0100
commit18ea5e372cdb0873cffebef67ea80abe01bcf138 (patch)
tree4fbe69ce1fbdeaa3f6d7bb5f310fa336a5da69cc
parentGroupBox: Fix size calculation and do some cleanup (diff)
downloadwireguard-windows-18ea5e372cdb0873cffebef67ea80abe01bcf138.tar.xz
wireguard-windows-18ea5e372cdb0873cffebef67ea80abe01bcf138.zip
declarative/TableView: Guard against invalid index, fixes #740
-rw-r--r--declarative/tableview.go6
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)
+ }
}
}