From 01b34ba9931f8b319ca2764c2ac8bedeacd2ab17 Mon Sep 17 00:00:00 2001 From: Braeden Fichtner Date: Tue, 27 May 2025 15:10:25 -0400 Subject: [PATCH] Fix #2740: Use Cpu.Unknown if using unsupported OS --- src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs b/src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs index 22d2c4e5b4..0abb7b8e49 100644 --- a/src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs +++ b/src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs @@ -78,7 +78,7 @@ protected HostEnvironmentInfo() AntivirusProducts = new Lazy>(RuntimeInformation.GetAntivirusProducts); VirtualMachineHypervisor = new Lazy(RuntimeInformation.GetVirtualMachineHypervisor); Os = new Lazy(OsDetector.GetOs); - Cpu = new Lazy(CpuDetector.CrossPlatform.Detect); + Cpu = new Lazy(() => CpuDetector.CrossPlatform.Detect() ?? CpuInfo.Unknown); } public new static HostEnvironmentInfo GetCurrent() => current ??= new HostEnvironmentInfo();