File tree 2 files changed +8
-5
lines changed
vscode-dotnet-runtime-library/src/EventStream
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -330,8 +330,7 @@ export class DotnetAcquisitionInProgress extends IEvent {
330
330
constructor ( public readonly version : string , public readonly requestingExtensionId : string | null ) { super ( ) ; }
331
331
332
332
public getProperties ( ) {
333
- return { InProgressInstallationVersion : this . version , extensionId : this . requestingExtensionId != null ?
334
- TelemetryUtilities . HashData ( this . requestingExtensionId ) : '' } ;
333
+ return { InProgressInstallationVersion : this . version , extensionId : TelemetryUtilities . HashData ( this . requestingExtensionId ) } ;
335
334
}
336
335
}
337
336
@@ -342,8 +341,7 @@ export class DotnetAcquisitionAlreadyInstalled extends IEvent {
342
341
constructor ( public readonly version : string , public readonly requestingExtensionId : string | null ) { super ( ) ; }
343
342
344
343
public getProperties ( ) {
345
- return { AlreadyInstalledVersion : this . version , extensionId : this . requestingExtensionId != null ?
346
- TelemetryUtilities . HashData ( this . requestingExtensionId ) : '' } ;
344
+ return { AlreadyInstalledVersion : this . version , extensionId : TelemetryUtilities . HashData ( this . requestingExtensionId ) } ;
347
345
}
348
346
}
349
347
Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ import { TextEncoder } from 'util';
9
9
10
10
export class TelemetryUtilities
11
11
{
12
- public static HashData ( dataToHash : string ) : string
12
+ public static HashData ( dataToHash : string | null ) : string
13
13
{
14
+ if ( ! dataToHash )
15
+ {
16
+ return '' ;
17
+ }
18
+
14
19
const hasher = crypto . createHash ( 'sha256' ) ;
15
20
const utf8Bytes = new TextEncoder ( ) . encode ( dataToHash . toUpperCase ( ) ) ;
16
21
const hashedData = hasher . update ( utf8Bytes ) . digest ( 'hex' ) . toLowerCase ( ) ;
You can’t perform that action at this time.
0 commit comments