From 9994674d60a85d2c18e2192ef58195fff743091f Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 7 Mar 2022 23:21:20 +0100 Subject: [PATCH] Bugfix: Movement on empty tables could lead to infinite loops. Fixes #705, resolves #706 --- table.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/table.go b/table.go index 0ac6360..7cf4df6 100644 --- a/table.go +++ b/table.go @@ -1329,6 +1329,9 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi previouslySelectedRow, previouslySelectedColumn := t.selectedRow, t.selectedColumn lastColumn := t.content.GetColumnCount() - 1 rowCount := t.content.GetRowCount() + if rowCount == 0 { + return // No movement on empty tables. + } var ( previous = func() { startRow := t.selectedRow