summaryrefslogtreecommitdiff
path: root/widgets/account.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/account.go')
-rw-r--r--widgets/account.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 1220753..eb6a495 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -185,7 +185,11 @@ func (acct *AccountView) SelectedMessage() (*models.MessageInfo, error) {
if len(acct.msglist.Store().Uids()) == 0 {
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 {