Skip to content

Fix crash when PowerShell selection is changed #2261

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

Merged
merged 3 commits into from
Oct 30, 2019

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Oct 30, 2019

No description provided.


if (lowerConfiguredPath === lowerAltWinPSPath) {
return this.winPS.exePath;
return this.findWinPS().exePath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to run findWinPS here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically, if you've configured a PowerShell path and it points to a non-native bitness, this method is supposed to fix it.

findWinPS() gives us back the native bitness Win PS.

It doesn't actually touch the filesystem, and is even cached.

Now that the laziness has come out, the way to reliably get the cached value is to call the method.

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjmholt
Copy link
Contributor Author

rjmholt commented Oct 30, 2019

Added tests!

@rjmholt rjmholt merged commit c7a2adb into PowerShell:master Oct 30, 2019
@rjmholt rjmholt deleted the fix-selection-change branch December 11, 2019 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants