From 58db517c8d79c7fd8897d8ab5d5cf9c2de67a071 Mon Sep 17 00:00:00 2001 From: Ray Ganardi Date: Tue, 19 May 2020 13:06:46 +0200 Subject: pgp: fail gracefully from email decryption Aerc panics when there's an error on email decryption. Instead, an error message should be shown. --- widgets/msglist.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'widgets/msglist.go') diff --git a/widgets/msglist.go b/widgets/msglist.go index f36901f6..5aedb446 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -166,7 +166,11 @@ func (ml *MessageList) MouseEvent(localX int, localY int, event tcell.Event) { return } lib.NewMessageStoreView(msg, store, ml.aerc.DecryptKeys, - func(view lib.MessageView) { + func(view lib.MessageView, err error) { + if err != nil { + ml.aerc.PushError(err.Error()) + return + } viewer := NewMessageViewer(acct, ml.aerc.Config(), view) ml.aerc.NewTab(viewer, msg.Envelope.Subject) }) -- cgit