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

Added null check to GetCompletionsAsync #2115

Conversation

dkattan
Copy link
Contributor

@dkattan dkattan commented Dec 15, 2023

PR Summary

Occasionally TabExpansion2 may return null. This could be due to a custom implementation of TabExpansion2 or an underlying issue with the FileSystemProvider or LocationGlobber.

When this happens the value of commandCompletion is not assigned and remains null. This causes a NullReferenceException to be thrown when commandCompletion.ReplacementLength is accessed in the subsequent call to LogTrace.

PR Context

@dkattan dkattan requested a review from a team December 15, 2023 16:24
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

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

Good catch, just need to fix up what's now dead code around it.

@andyleejordan andyleejordan force-pushed the hotfix/null-reference-on-private-psprovider-completion branch from b5f2942 to 9efac1c Compare February 12, 2024 20:54
@andyleejordan andyleejordan force-pushed the hotfix/null-reference-on-private-psprovider-completion branch from 9efac1c to 5a4dc37 Compare February 12, 2024 21:00
@andyleejordan
Copy link
Member

ERROR: Your current culture is (Invariant Language (Invariant Country)), which is not associated with any language, consider changing your system culture or install the English-US help content using: Update-Help -UICulture en-US.

LMAO.

@andyleejordan andyleejordan changed the title Added null check to GetCompletionsAsync Added null check to GetCompletionsAsync Feb 12, 2024
@andyleejordan andyleejordan added this pull request to the merge queue Feb 12, 2024
Merged via the queue into PowerShell:main with commit 021d381 Feb 12, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants