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>
This commit is contained in:
parent
44f81c87e4
commit
e5ad877af5
2 changed files with 10 additions and 0 deletions
lib
|
@ -523,6 +523,13 @@ func (store *MessageStore) updateVisual() {
|
|||
for _, uid := range visUids {
|
||||
store.marked[uid] = struct{}{}
|
||||
}
|
||||
missing := make([]uint32, 0)
|
||||
for _, uid := range visUids {
|
||||
if msg, _ := store.Messages[uid]; msg == nil {
|
||||
missing = append(missing, uid)
|
||||
}
|
||||
}
|
||||
store.FetchHeaders(missing, nil)
|
||||
}
|
||||
|
||||
func (store *MessageStore) NextPrev(delta int) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue