diff options
author | Bence Ferdinandy <bence@ferdinandy.com> | 2024-08-17 21:04:29 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-08-20 09:30:19 +0200 |
commit | f2ac5a7c3c6516289c5c07e85dad41d7379df771 (patch) | |
tree | b2cd2a5bdffb11cdc2b75624b075bb3e87e53293 /config/templates.go | |
parent | a2cf34e2b46268455b0224d062419bc091dc5f9c (diff) | |
download | aerc-f2ac5a7c3c6516289c5c07e85dad41d7379df771.tar.gz |
templates: fix AccountFrom default breaking startup
The default of {{.AccountFrom}} is currently nil. During startup, if
index-columns has something like {{.AccountFrom.Address}} then startup
will fail due to nil pointer evaluation. Add an example address to
return.
Fixes: 1d4eafb011f4 ("templates: add {{.AccountFrom}} template")
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: skejg <grolleman@zoho.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config/templates.go')
-rw-r--r-- | config/templates.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config/templates.go b/config/templates.go index 14da731b..a74386cf 100644 --- a/config/templates.go +++ b/config/templates.go @@ -66,7 +66,7 @@ var ( func (d *dummyData) Account() string { return "work" } func (d *dummyData) AccountBackend() string { return "maildir" } -func (d *dummyData) AccountFrom() *mail.Address { return nil } +func (d *dummyData) AccountFrom() *mail.Address { return &addr1 } func (d *dummyData) Signature() string { return "" } func (d *dummyData) Folder() string { return "INBOX" } func (d *dummyData) To() []*mail.Address { return []*mail.Address{&addr1} } |