From d11d35bb2ee3928a83f105cb4f57a57d647687b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Mercier?= Date: Tue, 14 Apr 2026 10:22:54 -0400 Subject: [PATCH] X570 null exception and pdb in release (#2300) * X570_MS7C35 nullref Fix nullref * No debug symbols/pdb in release * Update LibreHardwareMonitorLib.csproj --- .../Hardware/Motherboard/SuperIOHardware.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/LibreHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs b/LibreHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs index 1fe59a8..047d3ce 100644 --- a/LibreHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs +++ b/LibreHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs @@ -6099,22 +6099,21 @@ internal sealed class SuperIOHardware : Hardware { if (_motherboard.Model == Model.X570_MS7C35) // Add Temp Value for CPU MOS TEMPERATURE & PCH TEMPERATURE { - float voltage; + float? voltage = null; if (sensor.Index == 24) { - voltage = (float)_readVoltage(6); + voltage = _readVoltage(6); } else if (sensor.Index == 25) { - voltage = (float)_readVoltage(11); - } - else - { - voltage = 0; + voltage = _readVoltage(11); } - double R = (10000.0 * voltage / (2.048 - 1.0)); //Convert voltage measured to resistance value + if (!voltage.HasValue || voltage.Value <= 0) + continue; + + double R = (10000.0 * voltage.Value / (2.048 - 1.0)); //Convert voltage measured to resistance value double T = ((298.15 * 3435.0) / ((298.15 * Math.Log(R / 10000.0)) + 3435.0)); // Use R value in steinhart and hart equation, calculate temperature value in kelvin float Tc = (float)(T - 273.15); // Converting kelvin to celsius