Skip to content

Commit bf25e94

Browse files
chuckjazvicb
authored andcommitted
fix(language-service): guard access to Symbol.members (#15529)
Fixes #15528 What is the current behavior? The language service access TypeScript's Symbol.members without checking for null or undefined. What is the new behavior? The access is guarded.
1 parent 7983414 commit bf25e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/language-service/src/typescript_host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class TypeScriptSymbolQuery implements SymbolQuery {
668668
getSpanAt(line: number, column: number): Span { return spanAt(this.source, line, column); }
669669

670670
private getTemplateRefContextType(type: ts.Symbol): ts.Symbol {
671-
const constructor = type.members['__constructor'];
671+
const constructor = type.members && type.members['__constructor'];
672672
if (constructor) {
673673
const constructorDeclaration = constructor.declarations[0] as ts.ConstructorTypeNode;
674674
for (const parameter of constructorDeclaration.parameters) {

0 commit comments

Comments
 (0)