Add null check in allowed template check

This commit is contained in:
Benjamin Carleski
2019-10-02 14:16:03 -07:00
committed by Sebastiaan Janssen
parent 9c28a1ff80
commit e0ea4ef36f

View File

@@ -135,6 +135,9 @@ namespace Umbraco.Web
public static bool IsAllowedTemplate(this IPublishedContent content, int templateId)
{
if (content == null)
return false;
if (UmbracoConfig.For.UmbracoSettings().WebRouting.DisableAlternativeTemplates == true)
return content.TemplateId == templateId;