From 4683cb5bada7ebd5c804963e1d76417835cff4e1 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 29 May 2018 09:06:16 -0700 Subject: [PATCH] Add assertions --- scripts/tslint/rules/nextLineRule.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tslint/rules/nextLineRule.ts b/scripts/tslint/rules/nextLineRule.ts index fa03746afc6..9de80793c62 100644 --- a/scripts/tslint/rules/nextLineRule.ts +++ b/scripts/tslint/rules/nextLineRule.ts @@ -52,8 +52,8 @@ function walk(ctx: Lint.WalkContext, checkCatch: boolean, checkElse: boole return; } - const tryClosingBrace = tryBlock.getLastToken(sourceFile); - const catchKeyword = catchClause.getFirstToken(sourceFile); + const tryClosingBrace = tryBlock.getLastToken(sourceFile)!; + const catchKeyword = catchClause.getFirstToken(sourceFile)!; const tryClosingBraceLoc = sourceFile.getLineAndCharacterOfPosition(tryClosingBrace.getEnd()); const catchKeywordLoc = sourceFile.getLineAndCharacterOfPosition(catchKeyword.getStart(sourceFile)); if (tryClosingBraceLoc.line === catchKeywordLoc.line) {