From b74ee453e851ad133d2f7c5ea669baafcb31b487 Mon Sep 17 00:00:00 2001 From: Gentleelephant Date: Wed, 6 Mar 2024 18:29:44 +0800 Subject: [PATCH] fix bug Signed-off-by: Gentleelephant --- pkg/notify/notifier/email/email.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/notify/notifier/email/email.go b/pkg/notify/notifier/email/email.go index 4b1ff94..fd690b1 100644 --- a/pkg/notify/notifier/email/email.go +++ b/pkg/notify/notifier/email/email.go @@ -19,6 +19,8 @@ import ( "strings" "time" + "github.com/modern-go/reflect2" + "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/kubesphere/notification-manager/pkg/async" @@ -203,7 +205,7 @@ func (n *Notifier) send(ctx context.Context, to, subject, body string) error { if err != nil { return err } - if conn == nil { + if reflect2.IsNil(conn) { return utils.Errorf("failed to connect to %s", addr) }