From 97aa623e8798e557173c462b68a501aaad734310 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 14 Nov 2023 10:51:06 +0100 Subject: [PATCH] Fixed smalled things due to nullable refernece types --- src/Umbraco.Web.Common/Profiler/WebProfiler.cs | 4 ++-- src/Umbraco.Web.Common/Profiler/WebProfilerHtml.cs | 2 +- tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.Common/Profiler/WebProfiler.cs b/src/Umbraco.Web.Common/Profiler/WebProfiler.cs index 9608bad715..8767b450fe 100644 --- a/src/Umbraco.Web.Common/Profiler/WebProfiler.cs +++ b/src/Umbraco.Web.Common/Profiler/WebProfiler.cs @@ -29,7 +29,7 @@ public class WebProfiler : IProfiler public void Start() { MiniProfiler.StartNew(); - MiniProfilerContext.Value = MiniProfiler.Current; + MiniProfilerContext.Value = MiniProfiler.Current!; } public void Stop(bool discardResults = false) => MiniProfilerContext.Value?.Stop(discardResults); @@ -84,7 +84,7 @@ public class WebProfiler : IProfiler if (cookieValue is not null) { - AddSubProfiler(MiniProfiler.FromJson(cookieValue)); + AddSubProfiler(MiniProfiler.FromJson(cookieValue)!); } // If it is a redirect to a relative path (local redirect) diff --git a/src/Umbraco.Web.Common/Profiler/WebProfilerHtml.cs b/src/Umbraco.Web.Common/Profiler/WebProfilerHtml.cs index 733715cf53..31319d8b01 100644 --- a/src/Umbraco.Web.Common/Profiler/WebProfilerHtml.cs +++ b/src/Umbraco.Web.Common/Profiler/WebProfilerHtml.cs @@ -34,7 +34,7 @@ public class WebProfilerHtml : IProfilerHtml var result = StackExchange.Profiling.Internal.Render.Includes( profiler, - context is not null ? context.Request.PathBase + path : null, + context is not null ? context.Request.PathBase + path : string.Empty, true, new List { profiler.Id }, RenderPosition.Right, diff --git a/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj b/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj index 067d2c4058..9b538de97e 100644 --- a/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj +++ b/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj @@ -9,7 +9,6 @@ -