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:
@@ -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("@"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user