-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add import null reference exception #48967
Conversation
{ | ||
var awaitExpression = FirstAwaitExpressionAncestor(syntaxFactsService, node); | ||
|
||
var innerExpression = syntaxFactsService.GetExpressionOfAwaitExpression(awaitExpression); | ||
|
||
if (innerExpression is null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bonus fix. Callers to GetAwaitInfo
already handle when it returns null.
{ | ||
var collectionExpression = FirstForeachCollectionExpressionAncestor(syntaxFactsService, node); | ||
|
||
if (collectionExpression is null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the real fix. Callers to GetCollectionExpressionType
already handle when it returns null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks good.
@davidwengier Did we have any heap dumps of the failure?
No, I think @tmat just hit it randomly yesterday. |
Hello @davidwengier! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-approval
Fixes #48891
I couldn't get a repro of this, but its a fairly obvious fix. See comments below.
First commit annotates, second commit fixes the bug.