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.
This commit is contained in:
Chuck Jazdzewski 2017-03-27 17:40:48 -07:00 committed by Victor Berchet
parent a9ae4daab2
commit 920bf373fe
1 changed files with 1 additions and 1 deletions

View File

@ -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) {