Add nullability to web.common

This commit is contained in:
Nikolaj Geisle
2022-03-29 13:44:21 +02:00
parent 86ae730b1e
commit b52c4e50cf
151 changed files with 731 additions and 675 deletions

View File

@@ -93,8 +93,8 @@ namespace Umbraco.Cms.Web.Common.Controllers
// set the redirect result and do not call next to short circuit
context.Result = pcr.IsRedirectPermanent()
? RedirectPermanent(pcr.RedirectUrl)
: Redirect(pcr.RedirectUrl);
? RedirectPermanent(pcr.RedirectUrl!)
: Redirect(pcr.RedirectUrl!);
break;
case UmbracoRouteResult.NotFound:
// set the redirect result and do not call next to short circuit
@@ -107,10 +107,10 @@ namespace Umbraco.Cms.Web.Common.Controllers
// If there it is means that we are proxying/executing this controller
// from another controller and we need to merge it's ViewData with this one
// since this one will be empty.
ProxyViewDataFeature saveViewData = HttpContext.Features.Get<ProxyViewDataFeature>();
ProxyViewDataFeature? saveViewData = HttpContext.Features.Get<ProxyViewDataFeature>();
if (saveViewData != null)
{
foreach (KeyValuePair<string, object> kv in saveViewData.ViewData)
foreach (KeyValuePair<string, object?> kv in saveViewData.ViewData)
{
ViewData[kv.Key] = kv.Value;
}