Skip to content

Commit

Permalink
No sites found from OOB solution.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason MacLean authored and Jason MacLean committed Jun 20, 2021
1 parent 77aec80 commit bcdadc1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,15 @@ private SiteContext GetSiteContext(Item item)
try
{
string siteName = item.Paths.FullPath.Split('/').Where(x => !string.IsNullOrWhiteSpace(x)).Distinct().ToList()[2].ToLowerInvariant();
var siteContext = Factory.GetSite(siteName);

return Factory.GetSite(siteName);
if (siteContext == null)
{
Log.Info($"Sitecore.Feature.PublishedPageUrl.Pipelines.ShowPublishedPageUrl.GetSiteContext -> No site context found based off item path. Assuming \"website\".", this);
siteContext = Factory.GetSite("website");
}

return siteContext;
}
catch (Exception ex)
{
Expand Down

0 comments on commit bcdadc1

Please sign in to comment.