~sircmpwn/aerc

Fix segfault on delete v1 PROPOSED

Thanks!

To git.sr.ht:~sircmpwn/aerc
   282dc44..572d9ff  master -> master
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/%3C20190910135340.921-1-djohnson1865%40gmail.com%3E/mbox | git am -3
Learn more about email & git

[PATCH] Fix segfault on delete Export this patch

Devon Johnson
diff --git a/widgets/account.go b/widgets/account.go
index 688b660..816d2ab 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -178,7 +178,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 {
-- 
2.21.0
Thanks!

To git.sr.ht:~sircmpwn/aerc
   282dc44..572d9ff  master -> master
View this thread in the archives