Skip to content

Commit

Permalink
Merge pull request #470 from Jaya21-git/master
Browse files Browse the repository at this point in the history
Code optimized
  • Loading branch information
muso31 authored Sep 13, 2024
2 parents f819e48 + 84d416a commit d3518a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Source/Glass.Mapper.Sc/SitecoreVersionAbstractions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public static string GetMediaUrl(MediaItem media)
public static string GetItemUrl(Item item, UrlOptions urlOptions)
{
#if SC104
if (item?.Paths == null) return string.Empty;
if (!item?.Paths.IsFullyQualified && item?.Parent == null) return string.Empty;
if (item?.Paths == null || (!item.Paths.IsFullyQualified && item.Parent == null)) return string.Empty;
var paths = item.Paths.GetPathParts(urlOptions?.UseDisplayName == true ? ItemPathType.DisplayName : ItemPathType.Name);
if (paths == null || paths.Length == 0)
{
Expand Down

0 comments on commit d3518a4

Please sign in to comment.