diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-01-22 14:54:11 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-01-22 17:07:50 +0100 |
commit | e5ad877af5629d8b29350bb9ff476afaa92a3c49 (patch) | |
tree | 187de02e690b07d98754fe7f407a6b3e165ccd83 /commands/util.go | |
parent | 44f81c87e47f80d7f29018ac0f7254dbb233e429 (diff) | |
download | aerc-e5ad877af5629d8b29350bb9ff476afaa92a3c49.tar.gz |
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 <koni.marti@gmail.com>
Diffstat (limited to 'commands/util.go')
-rw-r--r-- | commands/util.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 } |