File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -25,16 +25,23 @@ export namespace Telemetry {
2525 if ( ! ! telemetryManager ) {
2626 throw new Error ( "The telemetry service for vscode-java has already been started" ) ;
2727 }
28- workspaceHash = cyrb53 ( workspace . workspaceFolders . map ( f => f . uri . toString ( ) ) . join ( '|' ) ) ;
28+ workspaceHash = computeWorkspaceHash ( ) ;
2929 workspace . onDidChangeWorkspaceFolders ( ( ) => {
30- workspaceHash = cyrb53 ( workspace . workspaceFolders . map ( f => f . uri . toString ( ) ) . join ( '|' ) ) ;
30+ workspaceHash = computeWorkspaceHash ( ) ;
3131 } ) ;
3232 const redhatService = await getRedHatService ( context ) ;
3333 const telemService = await redhatService . getTelemetryService ( ) ;
3434 telemetryManager = telemService ;
3535 return telemService ;
3636 }
3737
38+ function computeWorkspaceHash ( ) : number {
39+ if ( ! workspace . workspaceFolders ?. length ) {
40+ return 0 ;
41+ }
42+ return cyrb53 ( workspace . workspaceFolders . map ( f => f . uri . toString ( ) ) . join ( '|' ) ) ;
43+ }
44+
3845 /**
3946 * Send a telemetry event with the given name and data
4047 *
You can’t perform that action at this time.
0 commit comments