Skip to content

Commit

Permalink
Check null in RenderTitleSegments (OrchardCMS#2393)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriffard authored and sebastienros committed Sep 17, 2018
1 parent dcc2fd6 commit 6a9751e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/OrchardCore/OrchardCore.DisplayManagement/Razor/RazorPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void EnsureShapeFactory()
_shapeFactory = Context.RequestServices.GetService<IShapeFactory>();
}
}

/// <summary>
/// Gets a dynamic shape factory to create new shapes.
/// </summary>
Expand Down Expand Up @@ -231,10 +231,14 @@ public IHtmlContent RenderTitleSegments(IHtmlContent segment, string position =
/// <returns>And <see cref="IHtmlContent"/> instance representing the full title.</returns>
public IHtmlContent RenderTitleSegments(string segment, string position = "0", IHtmlContent separator = null)
{
Title.AddSegment(new HtmlString(HtmlEncoder.Encode(segment)), position);
if (!String.IsNullOrEmpty(segment))
{
Title.AddSegment(new HtmlString(HtmlEncoder.Encode(segment)), position);
}

return Title.GenerateTitle(separator);
}

/// <summary>
/// Renders the content zone of the layout.
/// </summary>
Expand Down

0 comments on commit 6a9751e

Please sign in to comment.