Don't throw exception when node has no template and asking for GetTemplateAlias (return string.Empty instead)

This commit is contained in:
Sebastiaan Janssen
2013-08-23 14:08:13 +02:00
parent 16ed85ecc9
commit ad44feb6dd

View File

@@ -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