Fixed null-ref with reserved word inside a code block (dotnet/aspnetcore-tooling#192)
\n\nCommit migrated from 10dbc434ee
This commit is contained in:
parent
b15af76917
commit
57c10c0321
|
|
@ -2179,6 +2179,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
|
||||||
CompleteBlock();
|
CompleteBlock();
|
||||||
var keyword = OutputAsMetaCode(Output());
|
var keyword = OutputAsMetaCode(Output());
|
||||||
var directiveBody = SyntaxFactory.RazorDirectiveBody(keyword, cSharpCode: null);
|
var directiveBody = SyntaxFactory.RazorDirectiveBody(keyword, cSharpCode: null);
|
||||||
|
|
||||||
|
// transition could be null if we're already inside a code block.
|
||||||
|
transition = transition ?? SyntaxFactory.CSharpTransition(SyntaxFactory.MissingToken(SyntaxKind.Transition));
|
||||||
var directive = SyntaxFactory.RazorDirective(transition, directiveBody);
|
var directive = SyntaxFactory.RazorDirective(transition, directiveBody);
|
||||||
builder.Add(directive);
|
builder.Add(directive);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue