Skip to content

Commit

Permalink
Fix edge case where table without columns is allowed to have selectab…
Browse files Browse the repository at this point in the history
…le rows (#110)
  • Loading branch information
Evertras committed Jun 23, 2022
1 parent 2aeb5b4 commit 2cb4d63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion table/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (m Model) KeyMap() KeyMap {
func (m Model) SelectableRows(selectable bool) Model {
m.selectableRows = selectable

hasSelectColumn := m.columns[0].key == columnKeySelect
hasSelectColumn := len(m.columns) > 0 && m.columns[0].key == columnKeySelect

if hasSelectColumn != selectable {
if selectable {
Expand Down

0 comments on commit 2cb4d63

Please sign in to comment.