~sircmpwn/aerc

Fix crash if there is no to address for %F v1 PROPOSED

Thorben Günther: 1
 Fix crash if there is no to address for %F

 1 files changed, 3 insertions(+), 0 deletions(-)
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/patches/9114/mbox | git am -3
Learn more about email & git

[PATCH] Fix crash if there is no to address for %F Export this patch

diff --git a/lib/format/format.go b/lib/format/format.go
index a070bc9..749c8da 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -126,6 +126,9 @@ func ParseMessageFormat(
 			var val string
 
 			if addr.Name == accountFromAddress.Name {
+				if len(msg.Envelope.To) == 0 {
+					return "", nil, errors.New("(no address)")
+				}
 				addr = msg.Envelope.To[0]
 			}
 
-- 
2.24.0
View this thread in the archives