diff --git a/src/rules/trailingCommaRule.ts b/src/rules/trailingCommaRule.ts index ce2668a60d6..941122c1197 100644 --- a/src/rules/trailingCommaRule.ts +++ b/src/rules/trailingCommaRule.ts @@ -229,12 +229,19 @@ class TrailingCommaWalker extends Lint.AbstractWalker { case ts.SyntaxKind.ConstructorType: case ts.SyntaxKind.FunctionType: case ts.SyntaxKind.CallSignature: - this.checkList( - (node as ts.SignatureDeclaration).parameters, - getChildOfKind(node, ts.SyntaxKind.CloseParenToken, this.sourceFile)!.end, - "functions", - isRestParameter, + const closingParen = getChildOfKind( + node, + ts.SyntaxKind.CloseParenToken, + this.sourceFile, ); + if (closingParen !== undefined) { + this.checkList( + (node as ts.SignatureDeclaration).parameters, + closingParen.end, + "functions", + isRestParameter, + ); + } break; case ts.SyntaxKind.TypeLiteral: this.checkTypeLiteral(node as ts.TypeLiteralNode);