diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 9e23e0696..6ca54f006 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -871,6 +871,10 @@ namespace BTCPayServer.Controllers [HttpPost] public async Task DynamicDnsService(DynamicDnsViewModel viewModel, string hostname, string command = null) { + if (!ModelState.IsValid) + { + return View(viewModel); + } var settings = (await _SettingsRepository.GetSettingAsync()) ?? new DynamicDnsSettings(); var i = settings.Services.FindIndex(d => d.Hostname.Equals(hostname, StringComparison.OrdinalIgnoreCase));