From 70707492d76aaf7bc9674880decaa0af1323aa3a Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Fri, 20 Sep 2024 16:46:39 -0600 Subject: [PATCH] Only run email checker if a MailChecker is set --- email/helper.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/email/helper.go b/email/helper.go index 4b06504..ac1e611 100644 --- a/email/helper.go +++ b/email/helper.go @@ -80,12 +80,14 @@ func (h *Helper) Send(name, from, rcpt string, data gobwebs.Map) error { } checker := h.q.Checker() - if err := checker.Check(rcpt, h.CheckerLimit); err != nil { - // Email address check failed. Don't email - // We don't want to return error here. The checker.Check function - // should do all the individual use case logging and other work. - // XXX Maybe re-think this `return nil` decision in the future - return nil + if checker != nil { + if err := checker.Check(rcpt, h.CheckerLimit); err != nil { + // Email address check failed. Don't email + // We don't want to return error here. The checker.Check function + // should do all the individual use case logging and other work. + // XXX Maybe re-think this `return nil` decision in the future + return nil + } } var ( -- 2.45.2