Skip to content

Conversation

iisaduan
Copy link
Member

@iisaduan iisaduan commented Sep 2, 2025

fixes #1661

Fixes crash in tryUseExistingNamespaceImport from porting tryCast and optional handling

@iisaduan iisaduan requested review from gabritto and Copilot September 2, 2025 18:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a nil dereference crash in the autoimports functionality, specifically addressing issue #1661. The changes add null safety checks to prevent crashes when handling optional values during import processing.

  • Added nil checks for declaration.Name() to prevent accessing properties on nil objects
  • Added nil check for importClause.NamedBindings before accessing its properties

iisaduan and others added 2 commits September 2, 2025 11:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iisaduan iisaduan added this pull request to the merge queue Sep 2, 2025
Merged via the queue into microsoft:main with commit 6eff055 Sep 2, 2025
22 checks passed
@iisaduan iisaduan deleted the autoimports-tryusecrash branch September 2, 2025 19:49
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

LSP: Autoimports panic on text completion (just typing)
2 participants