From 2c0adf948a7c979b6529961f7ea87853817215fb Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Mon, 27 Jul 2020 11:45:04 +0200 Subject: [PATCH 1/2] Check if SMTP credentials are nil --- internal/http/services/ocmd/invites.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/http/services/ocmd/invites.go b/internal/http/services/ocmd/invites.go index 20cd80170e..d90cdd2646 100644 --- a/internal/http/services/ocmd/invites.go +++ b/internal/http/services/ocmd/invites.go @@ -44,7 +44,9 @@ type invitesHandler struct { func (h *invitesHandler) init(c *Config) { h.gatewayAddr = c.GatewaySvc - h.smtpCredentials = smtpclient.NewSMTPCredentials(c.SMTPCredentials) + if c.SMTPCredentials != nil { + h.smtpCredentials = smtpclient.NewSMTPCredentials(c.SMTPCredentials) + } h.meshDirectoryURL = c.MeshDirectoryURL } From 5d7144e9db33d3f1a3574f73852509b08e74ea1f Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Mon, 27 Jul 2020 11:58:51 +0200 Subject: [PATCH 2/2] Add changelog --- changelog/unreleased/smtp-credentials-nil | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/smtp-credentials-nil diff --git a/changelog/unreleased/smtp-credentials-nil b/changelog/unreleased/smtp-credentials-nil new file mode 100644 index 0000000000..44db254a02 --- /dev/null +++ b/changelog/unreleased/smtp-credentials-nil @@ -0,0 +1,6 @@ +Bugfix: Check if SMTP credentials are nil + +Check if SMTP credentials are nil before passing them to the +SMTPClient, causing it to crash. + +https://github.com/cs3org/reva/pull/1006