Skip to content

Commit

Permalink
Fixed item id check to have fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronSadlerUK committed Aug 16, 2021
1 parent 68c86e9 commit f9e1def
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/UmbNav.Core/Services/UmbNavMenuBuilderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public IEnumerable<UmbNavItem> BuildMenu(IEnumerable<UmbNavItem> items, int leve
item.IsActive = true;
}

if (item.Key != Guid.Empty)
if (item.Udi != null || item.Key != Guid.Empty || item.Id > 0)
{
IPublishedContent umbracoContent;
string currentCulture;
Expand All @@ -79,6 +79,11 @@ public IEnumerable<UmbNavItem> BuildMenu(IEnumerable<UmbNavItem> items, int leve
currentCulture = _publishedSnapshotAccessor.PublishedSnapshot.Content.GetById(item.Udi)?.GetCultureFromDomains();
umbracoContent = _publishedSnapshotAccessor.PublishedSnapshot.Content.GetById(item.Udi);
}
else if (item.Key != Guid.Empty)
{
currentCulture = _publishedSnapshotAccessor.PublishedSnapshot.Content.GetById(item.Key)?.GetCultureFromDomains();
umbracoContent = _publishedSnapshotAccessor.PublishedSnapshot.Content.GetById(item.Key);
}
else
{
currentCulture = _publishedSnapshotAccessor.PublishedSnapshot.Content.GetById(item.Id)?.GetCultureFromDomains();
Expand Down

0 comments on commit f9e1def

Please sign in to comment.