fix build errors

This commit is contained in:
Nikolaj Geisle
2022-04-04 10:34:13 +02:00
parent 57190fc676
commit 4710951185
48 changed files with 117 additions and 87 deletions

View File

@@ -15,7 +15,7 @@ namespace Umbraco.Extensions
this IEndpointRouteBuilder endpoints,
Type controllerType,
string rootSegment,
string areaName,
string? areaName,
string? prefixPathSegment,
string defaultAction = "Index",
bool includeControllerNameInRoute = true,
@@ -57,7 +57,7 @@ namespace Umbraco.Extensions
// named consistently
$"umbraco-{areaName}-{controllerName}".ToLowerInvariant(),
areaName,
areaName!,
pattern.ToString().ToLowerInvariant(),
defaults,
constraints);
@@ -98,7 +98,7 @@ namespace Umbraco.Extensions
/// </summary>
public static void MapUmbracoApiRoute(
this IEndpointRouteBuilder endpoints,
Type? controllerType,
Type controllerType,
string rootSegment,
string? areaName,
bool isBackOffice,

View File

@@ -47,7 +47,7 @@ namespace Umbraco.Extensions
if (!hasCookie) return false;
// get the cookie value
if (!httpContext.Request.Cookies.TryGetValue(cookieName, out var cookieVal))
if (httpContext is null || !httpContext.Request.Cookies.TryGetValue(cookieName, out var cookieVal))
{
return false;
}

View File

@@ -57,7 +57,7 @@ namespace Umbraco.Cms.Web.Common.ModelsBuilder
throw new ArgumentException("Null umbracoUrls");
}
if (!(umbracoUrlsObject is Dictionary<string, object> umbracoUrls))
if (!(umbracoUrlsObject is Dictionary<string, object?> umbracoUrls))
{
throw new ArgumentException("Invalid umbracoUrls");
}