Fix segfault on delete

This commit is contained in:
Devon Johnson 2019-09-10 06:53:40 -07:00 committed by Drew DeVault
parent 32381592fc
commit 572d9ff728
1 changed files with 5 additions and 1 deletions

View File

@ -185,7 +185,11 @@ func (acct *AccountView) SelectedMessage() (*models.MessageInfo, error) {
if len(acct.msglist.Store().Uids()) == 0 { if len(acct.msglist.Store().Uids()) == 0 {
return nil, errors.New("no message selected") return nil, errors.New("no message selected")
} }
return acct.msglist.Selected(), nil msg := acct.msglist.Selected()
if msg == nil {
return nil, errors.New("message not loaded")
}
return msg, nil
} }
func (acct *AccountView) SelectedMessagePart() *PartInfo { func (acct *AccountView) SelectedMessagePart() *PartInfo {