From ec44e94565c71916642ccadcdbf5016644450997 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Thu, 28 Sep 2023 21:52:00 -0700 Subject: [PATCH] Fix NPE that occurs if the initial sqlite query is slow, the user starts typing, and then the latter query is faster and completes first, by forcing an update of the table if it is nil before calling SetRows() on it --- client/tui/tui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/tui/tui.go b/client/tui/tui.go index 4f81cd1..443d9f4 100644 --- a/client/tui/tui.go +++ b/client/tui/tui.go @@ -227,7 +227,7 @@ func updateTable(m model, rows []table.Row, entries []*data.HistoryEntry, search if m.table != nil { initialCursor = m.table.Cursor() } - if forceUpdateTable { + if forceUpdateTable || m.table == nil { t, err := makeTable(m.ctx, rows) if err != nil { m.fatalErr = err