Fix: Exception for empty data- attributes in tag helpers (dotnet/aspnetcore-tooling#173)

\n\nCommit migrated from 6d71b6a265
This commit is contained in:
Ajay Bhargav Baaskaran 2019-01-30 09:12:37 -08:00 committed by GitHub
parent cdaad2964d
commit 57211a33db
1 changed files with 2 additions and 2 deletions

View File

@ -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)