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:
parent
eef662c606
commit
74c13e84b7
1 changed files with 3 additions and 2 deletions
|
@ -46,8 +46,9 @@ func NewMessageStore(worker *types.Worker,
|
||||||
triggerDirectoryChange func()) *MessageStore {
|
triggerDirectoryChange func()) *MessageStore {
|
||||||
|
|
||||||
return &MessageStore{
|
return &MessageStore{
|
||||||
Deleted: make(map[uint32]interface{}),
|
Deleted: make(map[uint32]interface{}),
|
||||||
DirInfo: *dirInfo,
|
DirInfo: *dirInfo,
|
||||||
|
Messages: make(map[uint32]*models.MessageInfo),
|
||||||
|
|
||||||
selected: 0,
|
selected: 0,
|
||||||
bodyCallbacks: make(map[uint32][]func(io.Reader)),
|
bodyCallbacks: make(map[uint32][]func(io.Reader)),
|
||||||
|
|
Loading…
Reference in a new issue