Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added null check to GetCompletionsAsync#2115

Merged
andyleejordan merged 1 commit into
PowerShell:mainPowerShell/PowerShellEditorServices:mainfrom
dkattan:hotfix/null-reference-on-private-psprovider-completiondkattan/PowerShellEditorServices:hotfix/null-reference-on-private-psprovider-completionCopy head branch name to clipboard
Feb 12, 2024
Merged

Added null check to GetCompletionsAsync#2115
andyleejordan merged 1 commit into
PowerShell:mainPowerShell/PowerShellEditorServices:mainfrom
dkattan:hotfix/null-reference-on-private-psprovider-completiondkattan/PowerShellEditorServices:hotfix/null-reference-on-private-psprovider-completionCopy head branch name to clipboard

Conversation

@dkattan

@dkattan dkattan commented Dec 15, 2023

Copy link
Copy Markdown
Contributor

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

@andyleejordan andyleejordan left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.