Skip to content

Fix NullReferenceException in GetDevConsoleInstance()#66

Merged
rainersigwald merged 1 commit intomicrosoft:masterfrom
ap0llo:master
May 10, 2019
Merged

Fix NullReferenceException in GetDevConsoleInstance()#66
rainersigwald merged 1 commit intomicrosoft:masterfrom
ap0llo:master

Conversation

@ap0llo
Copy link
Contributor

@ap0llo ap0llo commented May 8, 2019

Fixes #65

When the environment variable VSINSTALLDIR was set but VisualStudioVersion was not, GetDevConsoleInstance() was throwing a NullReferenceException because a null-Version was passed to the VisualStudioInstance constructor.

This PR adds a check to ensure version is not null. If the version is null, GetDevConsoleInstance will return null (i.e. no VS instance found)

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks for the contribution!

@rainersigwald rainersigwald merged commit 8b5c58f into microsoft:master May 10, 2019
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.

QueryVisualStudioInstances() fails with NullReferenceException when VSINSTALLDIR is set

2 participants