Skip to content

Commit

Permalink
Null check on customdomain (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
kows authored Jul 16, 2023
1 parent 0aa6ccf commit 464e73f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void Save(Redirect redirect)
if (redirect.Domain != null && existingRedirects.Any(it => it.Domain?.Id == redirect.Domain.Id))
throw new ArgumentException($"An redirect already exists for {oldUrl}");

if (!string.IsNullOrWhiteSpace(redirect.CustomDomain) && existingRedirects.Any(it => it.CustomDomain.Equals(redirect.CustomDomain)))
if (!string.IsNullOrWhiteSpace(redirect.CustomDomain) && existingRedirects.Any(it => !string.IsNullOrWhiteSpace(it.CustomDomain) && it.CustomDomain.Equals(redirect.CustomDomain)))
throw new ArgumentException($"An redirect already exists for {oldUrl}");
}

Expand Down

0 comments on commit 464e73f

Please sign in to comment.