Skip to content

Commit 51df010

Browse files
Remove null-conditional operator as suggested - TagHelperInfo.BindingResult cannot be null
Co-authored-by: DustinCampbell <[email protected]>
1 parent 3350e22 commit 51df010

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/CodeActions/Razor/SimplifyFullyQualifiedComponentCodeActionProvider.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,8 @@ private static bool IsFullyQualifiedComponent(MarkupTagHelperElementSyntax eleme
123123
@namespace = string.Empty;
124124
componentName = string.Empty;
125125

126-
if (element.TagHelperInfo?.BindingResult is not { } bindingResult)
127-
{
128-
return false;
129-
}
130-
131-
var boundTagHelper = bindingResult.Descriptors
132-
.FirstOrDefault(static d => d.Kind == TagHelperKind.Component);
126+
var descriptors = element.TagHelperInfo.BindingResult.Descriptors;
127+
var boundTagHelper = descriptors.FirstOrDefault(static d => d.Kind == TagHelperKind.Component);
133128
if (boundTagHelper is null)
134129
{
135130
return false;

0 commit comments

Comments
 (0)