From e5ad877af5629d8b29350bb9ff476afaa92a3c49 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sat, 22 Jan 2022 14:54:11 +0100 Subject: msgstore: fetch missing headers in visual mode fetches missing headers when in visual selection mode. This prevents large archive operations from panicking due to a nil pointer dereference. The archive command will return an error to the ui when a nil message is encountered to signal that the message store is not ready yet. Signed-off-by: Koni Marti --- commands/util.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'commands') diff --git a/commands/util.go b/commands/util.go index ffc5ed6c..f3f9bc83 100644 --- a/commands/util.go +++ b/commands/util.go @@ -188,6 +188,9 @@ func MsgInfoFromUids(store *lib.MessageStore, uids []uint32) ([]*models.MessageI if !ok { return nil, fmt.Errorf("uid not found") } + if infos[i] == nil { + return nil, fmt.Errorf("message store not ready yet") + } } return infos, nil } -- cgit