aboutsummaryrefslogtreecommitdiff
path: root/widgets/account.go
diff options
context:
space:
mode:
authorDevon Johnson <djohnson1865@gmail.com>2019-09-10 06:53:40 -0700
committerDrew DeVault <sir@cmpwn.com>2019-09-11 12:24:37 -0400
commit572d9ff72883264fbffe35e998b9a6193f20137a (patch)
tree72cac169e9cab0d164cdc51df5ac229f475de203 /widgets/account.go
parent32381592fc335bc26a06cee847df926b9f6e6c06 (diff)
Fix segfault on delete
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 {