Skip to content

Commit 57bbbfa

Browse files
committed
better null checks
1 parent 2ede064 commit 57bbbfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Umbraco.Web.Website/Routing/NotFoundSelectorPolicy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
@@ -34,8 +34,8 @@ private Endpoint GetNotFoundEndpoint()
3434
{
3535
// return the endpoint for the RenderController.Index action.
3636
ControllerActionDescriptor descriptor = x.Metadata?.GetMetadata<ControllerActionDescriptor>();
37-
return descriptor.ControllerTypeInfo == typeof(RenderController)
38-
&& descriptor.ActionName == nameof(RenderController.Index);
37+
return descriptor?.ControllerTypeInfo == typeof(RenderController)
38+
&& descriptor?.ActionName == nameof(RenderController.Index);
3939
});
4040
return e;
4141
}

0 commit comments

Comments
 (0)