-
Notifications
You must be signed in to change notification settings - Fork 223
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
Fix null dereference when debugging untitlted files #725
Conversation
var nonAwaitedTask = | ||
this.LaunchScript(requestContext) | ||
.ConfigureAwait(false); | ||
var nonAwaitedTask = LaunchScript(requestContext, _scriptToLaunch) |
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.
Here's the real change
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.
LGTM - I'm not too sure bit that that's the problem... but you've made the function more functional so I'm happy about that 👍
Well there's a null check around the call, but I assume the object field is changed after the check but before the evaluation. Here's the tail of the logs from the issue:
|
Makes sense :) |
To be honest I get the impression there are more than a few race conditions hanging around the codebase and sharing object fields over tasks is responsible. So a more functional style might be our saviour here |
PURE FUNCTIONS PLEASE |
|
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.
LGTM
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.
LGTM
+1 to there being a lot of race conditions. There's a lot of race condition fixes in the PSRL changes, but that was mostly through adding locks. Those areas could probably benefit from similar refactorings, the locks were more like stop gaps. Nice work!
Fixes PowerShell/vscode-powershell#1334.
I was looking at this trying to figure out what's going on, and I think what's happening is that the null check we do it not helpful because we don't await the execution of the method.
So I've changed it to pass the actual value of the string in at call time. I assume that will work, but let me know if not.
Also the first commit here was a style change one...