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; }