Fixed a NullReferenceException in HDD.Update.

This commit is contained in:
Michael Möller
2010-04-25 13:16:28 +00:00
parent f840d88254
commit 151f1600e7

View File

@@ -94,7 +94,8 @@ namespace OpenHardwareMonitor.Hardware.HDD {
public void Update() {
if (count == 0) {
SMART.DriveAttribute[] attributes = SMART.ReadSmart(handle, drive);
temperature.Value = attributes[attribute].RawValue[0];
if (attributes != null && attribute < attributes.Length)
temperature.Value = attributes[attribute].RawValue[0];
} else {
temperature.Value = temperature.Value;
}