Skip to content

Commit

Permalink
symbol.parent really is possibly sometimes undefined here. (microso…
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanCavanaugh authored Mar 3, 2020
1 parent 67c6ceb commit 0c5878d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/rename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0c5878d

Please sign in to comment.