Don't throw exception when node has no template and asking for GetTemplateAlias (return string.Empty instead)
This commit is contained in:
@@ -114,7 +114,7 @@ namespace Umbraco.Web
|
||||
public static string GetTemplateAlias(this IPublishedContent doc)
|
||||
{
|
||||
var template = Template.GetTemplate(doc.TemplateId);
|
||||
return template.Alias;
|
||||
return template != null ? template.Alias : string.Empty;
|
||||
}
|
||||
|
||||
#region GetPropertyValue
|
||||
|
||||
Reference in New Issue
Block a user