Skip to content

Commit 01b34ba

Browse files
committed
Fix #2740: Use Cpu.Unknown if using unsupported OS
1 parent 7da69ad commit 01b34ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected HostEnvironmentInfo()
7878
AntivirusProducts = new Lazy<ICollection<Antivirus>>(RuntimeInformation.GetAntivirusProducts);
7979
VirtualMachineHypervisor = new Lazy<VirtualMachineHypervisor>(RuntimeInformation.GetVirtualMachineHypervisor);
8080
Os = new Lazy<OsInfo>(OsDetector.GetOs);
81-
Cpu = new Lazy<CpuInfo>(CpuDetector.CrossPlatform.Detect);
81+
Cpu = new Lazy<CpuInfo>(() => CpuDetector.CrossPlatform.Detect() ?? CpuInfo.Unknown);
8282
}
8383

8484
public new static HostEnvironmentInfo GetCurrent() => current ??= new HostEnvironmentInfo();

0 commit comments

Comments
 (0)