From 920bf373fe041aae8d12c1d5b791da87b9235e6d Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Mon, 27 Mar 2017 17:40:48 -0700 Subject: [PATCH] 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. --- packages/language-service/src/typescript_host.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/language-service/src/typescript_host.ts b/packages/language-service/src/typescript_host.ts index 1faadf7fc5..59facc4b0c 100644 --- a/packages/language-service/src/typescript_host.ts +++ b/packages/language-service/src/typescript_host.ts @@ -668,7 +668,7 @@ class TypeScriptSymbolQuery implements SymbolQuery { getSpanAt(line: number, column: number): Span { return spanAt(this.source, line, column); } private getTemplateRefContextType(type: ts.Symbol): ts.Symbol { - const constructor = type.members['__constructor']; + const constructor = type.members && type.members['__constructor']; if (constructor) { const constructorDeclaration = constructor.declarations[0] as ts.ConstructorTypeNode; for (const parameter of constructorDeclaration.parameters) {