Initialize an empty message map in the message store on initialization

This addresses occasional crashes when a `MessageInfo` event reached the message
store before `DirectoryContents`, particularly on slower (imap) accounts.
This commit is contained in:
Rafael Castillo 2019-12-04 15:46:34 -07:00 committed by Drew DeVault
parent eef662c606
commit 74c13e84b7

View file

@ -46,8 +46,9 @@ func NewMessageStore(worker *types.Worker,
triggerDirectoryChange func()) *MessageStore {
return &MessageStore{
Deleted: make(map[uint32]interface{}),
DirInfo: *dirInfo,
Deleted: make(map[uint32]interface{}),
DirInfo: *dirInfo,
Messages: make(map[uint32]*models.MessageInfo),
selected: 0,
bodyCallbacks: make(map[uint32][]func(io.Reader)),