Skip to content

Commit

Permalink
Harden telemetryOnOpenFile
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanCavanaugh committed Feb 24, 2020
1 parent 94271aa commit 7721570
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/editorServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3096,8 +3096,9 @@ namespace ts.server {
return;
}

const info: OpenFileInfo = { checkJs: !!project.getSourceFile(scriptInfo.path)!.checkJsDirective };
this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info } });
const sourceFile = project.getSourceFile(scriptInfo.path);
const checkJs = !!sourceFile && !!sourceFile.checkJsDirective;
this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info: { checkJs } } });
}

/**
Expand Down

0 comments on commit 7721570

Please sign in to comment.