From 68fc83328026b40d29fa2f22d3c125353b289624 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 19 Nov 2012 16:09:43 -0100 Subject: [PATCH] U4-1186 - bugfix previous commit --- src/Umbraco.Web/Routing/DomainHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Routing/DomainHelper.cs b/src/Umbraco.Web/Routing/DomainHelper.cs index e62e0cb98a..a8ab38b4cc 100644 --- a/src/Umbraco.Web/Routing/DomainHelper.cs +++ b/src/Umbraco.Web/Routing/DomainHelper.cs @@ -51,9 +51,6 @@ namespace Umbraco.Web.Routing /// The domain and its normalized uri, that best matches the current uri, else the first domain (if defaultToFirst is true), else null. public static DomainAndUri DomainMatch(IEnumerable domains, Uri current, bool defaultToFirst) { - if (!domains.Any()) - return null; - // sanitize the list to have proper uris for comparison (scheme, path end with /) // we need to end with / because example.com/foo cannot match example.com/foobar // we need to order so example.com/foo matches before example.com/ @@ -64,6 +61,9 @@ namespace Umbraco.Web.Routing .OrderByDescending(t => t.UriString) .Select(t => new DomainAndUri { Domain = t.Domain, Uri = new Uri(t.UriString) }); + if (!domainsAndUris.Any()) + return null; + DomainAndUri domainAndUri; if (current == null) {