fixes null check which fixes a whole lot of failing tests

This commit is contained in:
Shannon
2018-04-26 23:48:07 +10:00
parent cb3cba5b05
commit 12d56cd201

View File

@@ -13,6 +13,9 @@ namespace Umbraco.Core.Models
public static bool IsDefaultDomain(this IDomain domain, ILocalizationService localizationService)
{
var defaultLang = localizationService.GetDefaultVariantLanguage();
if (defaultLang == null)
return false; //if for some reason a null value is returned (i.e. no languages or based on mock unit test data), then assume false
return domain.LanguageIsoCode == defaultLang.CultureName;
}
}