From e89096eeb67064760e060de15434a3f5df1f285b Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 14 Feb 2020 12:36:22 +1100 Subject: [PATCH] Dont call Thread.GetDomain() more than needed --- src/Umbraco.Web/UmbracoContextFactory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/UmbracoContextFactory.cs b/src/Umbraco.Web/UmbracoContextFactory.cs index 50d450112e..4c7ca2c2a3 100644 --- a/src/Umbraco.Web/UmbracoContextFactory.cs +++ b/src/Umbraco.Web/UmbracoContextFactory.cs @@ -90,7 +90,8 @@ namespace Umbraco.Web public static HttpContextBase EnsureHttpContext(HttpContextBase httpContext = null) { - if (Thread.GetDomain().GetData(".appPath") is null || Thread.GetDomain().GetData(".appVPath") is null) + var domain = Thread.GetDomain(); + if (domain.GetData(".appPath") is null || domain.GetData(".appVPath") is null) { return httpContext ?? new HttpContextWrapper(HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("", "", "null.aspx", "", NullWriterInstance)));