mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 17:53:58 +08:00
Adding missing guard for telemetry optout to avoid NRE when importing modules (#18949)
This commit is contained in:
parent
d29f34b5c2
commit
4e80e7611f
@ -661,6 +661,11 @@ namespace Microsoft.PowerShell.Telemetry
|
||||
/// <param name="moduleVersion">The module version to report. The default value is the anonymous version '0.0.0.0'.</param>
|
||||
internal static void SendModuleTelemetryMetric(TelemetryType telemetryType, string moduleName, string moduleVersion = AnonymousVersion)
|
||||
{
|
||||
if (!CanSendTelemetry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string allowedModuleName = GetModuleName(moduleName);
|
||||
|
Loading…
Reference in New Issue
Block a user