symbol.parent really is possibly sometimes undefined here. (#37159)

Fixes #37158
This commit is contained in:
Ryan Cavanaugh
2020-03-03 10:47:07 -08:00
committed by GitHub
parent 67c6cebfc8
commit 0c5878dfb1
+1 -1
View File
@@ -24,7 +24,7 @@ namespace ts.Rename {
}
// Cannot rename `default` as in `import { default as foo } from "./someModule";
if (isIdentifier(node) && node.originalKeywordKind === SyntaxKind.DefaultKeyword && symbol.parent!.flags & SymbolFlags.Module) {
if (isIdentifier(node) && node.originalKeywordKind === SyntaxKind.DefaultKeyword && symbol.parent && symbol.parent.flags & SymbolFlags.Module) {
return undefined;
}