Skip to content
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 startup bug when zero profiles are present #1807

Merged
merged 1 commit into from
May 19, 2022

Conversation

andyleejordan
Copy link
Member

The service would fail to fully start if zero profiles were present, because that meant we attempted to invoke an empty command, which then threw PSInvalidOperationException: No commands are specified. This wasn't caught by our task executor, since it happened in a delegate which directly invoked the command.

The service would fail to fully start if zero profiles were present,
because that meant we attempted to invoke an empty command, which then
threw `PSInvalidOperationException: No commands are specified`. This
wasn't caught by our task executor, since it happened in a delegate
which directly invoked the command.
@andyleejordan andyleejordan requested a review from a team May 19, 2022 20:14
// false` to avoid an exception here. Instead, we must just not execute it.
if (psCommand.Commands.Count > 0)
{
pwsh.InvokeCommand(psCommand);
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: @SeeminglyScience we should check everywhere else we directly invoke too.

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

LGTM!

@andyleejordan andyleejordan merged commit 7067575 into master May 19, 2022
@andyleejordan andyleejordan deleted the andschwa/no-profiles branch May 19, 2022 20:31
@SydneyhSmith SydneyhSmith mentioned this pull request Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants