mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
Reverting changes, validate email only if it was provided
This commit is contained in:
@@ -1256,8 +1256,8 @@ namespace BTCPayServer.Controllers
|
||||
return RedirectToAction(nameof(Emails));
|
||||
}
|
||||
|
||||
// save
|
||||
if (!MailboxAddressValidator.IsMailboxAddress(model.Settings.From))
|
||||
// save if user provided valid email; this will also clear settings if no model.Settings.From
|
||||
if (model.Settings.From is not null && !MailboxAddressValidator.IsMailboxAddress(model.Settings.From))
|
||||
{
|
||||
ModelState.AddModelError("Settings.From", StringLocalizer["Invalid email"]);
|
||||
return View(model);
|
||||
|
||||
Reference in New Issue
Block a user