Skip to content

Commit d76a45a

Browse files
TypeScript BotRyanCavanaugh
TypeScript Bot
andauthored
Cherry-pick PR #36993 into release-3.8 (#37020)
Component commits: 7721570 Harden telemetryOnOpenFile 9535e7b Merge branch 'master' of https://github.com/RyanCavanaugh/TypeScript into fix36984 Co-authored-by: Ryan Cavanaugh <RyanCavanaugh@users.noreply.github.com>
1 parent 98fc075 commit d76a45a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/server/editorServices.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3117,8 +3117,9 @@ namespace ts.server {
31173117
return;
31183118
}
31193119

3120-
const info: OpenFileInfo = { checkJs: !!project.getSourceFile(scriptInfo.path)!.checkJsDirective };
3121-
this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info } });
3120+
const sourceFile = project.getSourceFile(scriptInfo.path);
3121+
const checkJs = !!sourceFile && !!sourceFile.checkJsDirective;
3122+
this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info: { checkJs } } });
31223123
}
31233124

31243125
/**

0 commit comments

Comments
 (0)