1
0
mirror of https://github.com/bitwarden/server synced 2025-12-21 18:53:41 +00:00

[PM-336] Nullable Platform & Unowned Services (#5646)

* Nullable Platform & Unowned Services

* Fix build errors

* Format
This commit is contained in:
Justin Baur
2025-04-15 12:56:58 -04:00
committed by GitHub
parent 84a984a9e6
commit 2242a70e50
22 changed files with 141 additions and 84 deletions

View File

@@ -22,12 +22,17 @@ public class MailKitSmtpMailDeliveryService : IMailDeliveryService
ILogger<MailKitSmtpMailDeliveryService> logger,
IOptions<X509ChainOptions> x509ChainOptions)
{
if (globalSettings.Mail?.Smtp?.Host == null)
if (globalSettings.Mail.Smtp?.Host == null)
{
throw new ArgumentNullException(nameof(globalSettings.Mail.Smtp.Host));
}
_replyEmail = CoreHelpers.PunyEncode(globalSettings.Mail?.ReplyToEmail);
if (globalSettings.Mail.ReplyToEmail == null)
{
throw new InvalidOperationException("A GlobalSettings.Mail.ReplyToEmail is required to be set up.");
}
_replyEmail = CoreHelpers.PunyEncode(globalSettings.Mail.ReplyToEmail);
if (_replyEmail.Contains("@"))
{