Skip to content

Commit 0c5878d

Browse files
symbol.parent really is possibly sometimes undefined here. (#37159)
Fixes #37158
1 parent 67c6ceb commit 0c5878d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/rename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace ts.Rename {
2424
}
2525

2626
// Cannot rename `default` as in `import { default as foo } from "./someModule";
27-
if (isIdentifier(node) && node.originalKeywordKind === SyntaxKind.DefaultKeyword && symbol.parent!.flags & SymbolFlags.Module) {
27+
if (isIdentifier(node) && node.originalKeywordKind === SyntaxKind.DefaultKeyword && symbol.parent && symbol.parent.flags & SymbolFlags.Module) {
2828
return undefined;
2929
}
3030

0 commit comments

Comments
 (0)