#5564: Fixed potential NRE when tenant RequestUrlHost is empty.

Fixes #5564.
This commit is contained in:
Daniel Stolt
2015-07-24 16:40:47 +01:00
parent d6e96252e7
commit 34be0b302f

View File

@@ -7,7 +7,7 @@ namespace Orchard.MultiTenancy.Extensions {
public static class UrlHelperExtensions {
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
var requestUrlHost = tenantShellSettings.RequestUrlHost.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).First();
var requestUrlHost = !String.IsNullOrEmpty(tenantShellSettings.RequestUrlHost) ? tenantShellSettings.RequestUrlHost.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).First() : null;
//info: (heskew) might not keep the port/vdir insertion around beyond...
var port = string.Empty;