KirillOsenkov / RoslynQuoter

Roslyn tool that for a given C# program shows syntax tree API calls to construct its syntax tree
http://roslynquoter.azurewebsites.net
Apache License 2.0
918 stars 118 forks source link

Parsing a `using` statement as a `member` throws NullRef. #48

Closed otac0n closed 3 years ago

otac0n commented 5 years ago
using System.Collections.Generic;

Parse as: member

Congratulations! You've found a bug in Quoter! Please open an issue at https://github.com/KirillOsenkov/RoslynQuoter/issues/new and paste the code you've typed above and this stack:

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Object.GetType()
   at Quoter.QuotePropertyValues(SyntaxNode node) in C:\RoslynQuoter\src\Quoter\Quoter.cs:line 202
   at Quoter.QuoteNode(SyntaxNode node, String name) in C:\RoslynQuoter\src\Quoter\Quoter.cs:line 171
   at Quoter.Quote(Object treeElement, String name) in C:\RoslynQuoter\src\Quoter\Quoter.cs:line 163
   at Quoter.Quote(SyntaxNode node) in C:\RoslynQuoter\src\Quoter\Quoter.cs:line 125
   at QuoterService.Controllers.QuoterController.Get(String sourceText, NodeKind nodeKind, Boolean openCurlyOnNewLine, Boolean closeCurlyOnNewLine, Boolean preserveOriginalWhitespace, Boolean keepRedundantApiCalls, Boolean avoidUsingStatic, Boolean generateLINQPad) in C:\RoslynQuoter\src\Quoter.Web\Controllers\QuoterController.cs:line 39

P.S. Sorry!

P.S. No worries!

bernd5 commented 3 years ago

It is fixed...

KirillOsenkov commented 3 years ago

Ah, yes, thank you!