Fixes up UmbracoContextFactory to ensure it's not returning a disposed Umbraco context

This commit is contained in:
Shannon
2019-06-20 15:40:57 +10:00
parent 23702ee4dc
commit fcfb107653

View File

@@ -64,7 +64,7 @@ namespace Umbraco.Web
public UmbracoContextReference EnsureUmbracoContext(HttpContextBase httpContext = null)
{
var currentUmbracoContext = _umbracoContextAccessor.UmbracoContext;
if (currentUmbracoContext != null)
if (currentUmbracoContext != null && !currentUmbracoContext.Disposed)
return new UmbracoContextReference(currentUmbracoContext, false, _umbracoContextAccessor);