From 9ce79f5949fa704216a369a1a0994a9c58d3fbdb Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Mon, 27 Jul 2020 13:54:17 +0200 Subject: [PATCH] Check if SMTP credentials are nil (#1006) --- changelog/unreleased/smtp-credentials-nil | 6 ++++++ internal/http/services/ocmd/invites.go | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 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 }