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

This commit is contained in:
David Dworken 2023-09-28 21:52:00 -07:00
parent 6d5a86a8bb
commit ec44e94565
No known key found for this signature in database

View File

@ -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