From 5ee5ae11f99a8830af6fb4a94aca7f8ef2f68b94 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 25 Jun 2015 16:09:59 -0400 Subject: [PATCH] Check for definedness on the pattern's type. --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 763e4173287..64155fe7737 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12362,7 +12362,8 @@ namespace ts { node.parent.parent.kind === SyntaxKind.ObjectBindingPattern && node === (node.parent).propertyName) { let typeOfPattern = getTypeAtLocation(node.parent.parent); - let propertyDeclaration = getPropertyOfType(typeOfPattern, (node).text); + let propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, (node).text); + if (propertyDeclaration) { return propertyDeclaration; }