diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs
index c678073c64..a85cee77a6 100644
--- a/src/Umbraco.Web/umbraco.presentation/library.cs
+++ b/src/Umbraco.Web/umbraco.presentation/library.cs
@@ -1229,54 +1229,56 @@ namespace umbraco
/// The rendered template as a string
public static string RenderTemplate(int PageId, int TemplateId)
{
- try
+ if (UmbracoSettings.UseAspNetMasterPages)
{
- if (UmbracoSettings.UseAspNetMasterPages)
+ if (!umbraco.presentation.UmbracoContext.Current.LiveEditingContext.Enabled)
{
System.Collections.Generic.Dictionary