Fixing up the RoutePartDriver so it doesn't throw and exception when the slug is null.

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-29 09:40:06 -07:00
parent 7e6cbf091f
commit 8a215ef0a6

View File

@@ -54,8 +54,9 @@ namespace Orchard.Core.Routable.Drivers {
// TEMP: path format patterns replaces this logic
var path = part.Path;
if (path != null && path.EndsWith(part.Slug)) {
model.DisplayLeadingPath = path.Substring(0, path.Length - part.Slug.Length);
var slug = part.Slug ?? "";
if (path != null && path.EndsWith(slug)) {
model.DisplayLeadingPath = path.Substring(0, path.Length - slug.Length);
}
else {
var containerSlug = part.GetContainerSlug();