From 21cc3ce129b716f14b229b34dde64026b1f7549f Mon Sep 17 00:00:00 2001 From: Nojus Gudinavičius Date: Thu, 13 Jul 2023 16:14:48 +0300 Subject: config: recognize empty no-attachment-warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documentation above no-attachment-warning states "Leave empty to disable this feature". However, when left empty, it would always warn before sending an email without any attachments. Change to no warning if left empty. Signed-off-by: Nojus Gudinavičius Acked-by: Robin Jarry --- config/compose.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/compose.go b/config/compose.go index 017b9efb..4b92bddc 100644 --- a/config/compose.go +++ b/config/compose.go @@ -34,5 +34,8 @@ func (c *ComposeConfig) ParseLayout(sec *ini.Section, key *ini.Key) ([][]string, } func (c *ComposeConfig) ParseNoAttachmentWarning(sec *ini.Section, key *ini.Key) (*regexp.Regexp, error) { + if key.String() == "" { + return nil, nil + } return regexp.Compile(`(?im)` + key.String()) } -- cgit