Check in other places too

This commit is contained in:
Ryan Cavanaugh 2016-02-10 11:30:21 -08:00
parent d64bbc0bec
commit 8c9baf81c5

View file

@ -7414,7 +7414,7 @@ namespace ts {
function getTypeForThisExpressionFromJSDoc(node: Node) {
const typeTag = getJSDocTypeTag(node);
if (typeTag && typeTag.typeExpression.type.kind === SyntaxKind.JSDocFunctionType) {
if (typeTag && typeTag.typeExpression && typeTag.typeExpression.type && typeTag.typeExpression.type.kind === SyntaxKind.JSDocFunctionType) {
const jsDocFunctionType = <JSDocFunctionType>typeTag.typeExpression.type;
if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === SyntaxKind.JSDocThisType) {
return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);