From f2ac5a7c3c6516289c5c07e85dad41d7379df771 Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Sat, 17 Aug 2024 21:04:29 +0200 Subject: 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 Tested-by: skejg Acked-by: Robin Jarry --- config/templates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') 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} } -- cgit