Fix: Exception for empty data- attributes in tag helpers (dotnet/aspnetcore-tooling#173)
\n\nCommit migrated from 6d71b6a265
This commit is contained in:
parent
cdaad2964d
commit
57211a33db
|
|
@ -992,7 +992,7 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
|
||||
IReadOnlyList<SyntaxNode> children = node.ChildNodes();
|
||||
var position = node.Position;
|
||||
if (children.First() is MarkupBlockSyntax markupBlock &&
|
||||
if (children.FirstOrDefault() is MarkupBlockSyntax markupBlock &&
|
||||
markupBlock.Children.Count == 2 &&
|
||||
markupBlock.Children[0] is MarkupTextLiteralSyntax &&
|
||||
markupBlock.Children[1] is MarkupEphemeralTextLiteralSyntax)
|
||||
|
|
@ -1709,7 +1709,7 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
|
||||
IReadOnlyList<SyntaxNode> children = node.ChildNodes();
|
||||
var position = node.Position;
|
||||
if (children.First() is MarkupBlockSyntax markupBlock &&
|
||||
if (children.FirstOrDefault() is MarkupBlockSyntax markupBlock &&
|
||||
markupBlock.Children.Count == 2 &&
|
||||
markupBlock.Children[0] is MarkupTextLiteralSyntax &&
|
||||
markupBlock.Children[1] is MarkupEphemeralTextLiteralSyntax)
|
||||
|
|
|
|||
Loading…
Reference in New Issue