Skip to content

Commit

Permalink
fix: Fixed possible null ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nikcio committed Dec 3, 2022
1 parent ea59e14 commit 7e8efd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Nikcio.UHeadless.Content/Router/ContentRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ public virtual string SetBaseUrl(string baseUrl)
return request.GetRouteResult() switch
{
UmbracoRouteResult.Redirect => GetRedirect(request).AsEnumerableOfOne() ?? Enumerable.Empty<TContent>(),
UmbracoRouteResult.NotFound => default,
UmbracoRouteResult.NotFound => Enumerable.Empty<TContent>(),
UmbracoRouteResult.Success => request.PublishedContent != null ? request.PublishedContent.Descendants(culture).Select(content => contentRepository.GetConvertedContent(content, culture)) : Enumerable.Empty<TContent>(),
_ => default,
_ => Enumerable.Empty<TContent>(),
};
}
}

0 comments on commit 7e8efd4

Please sign in to comment.