mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 22:35:11 +00:00
Fixed a NullReferenceException in HDD.Update.
This commit is contained in:
@@ -94,7 +94,8 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
|||||||
public void Update() {
|
public void Update() {
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
SMART.DriveAttribute[] attributes = SMART.ReadSmart(handle, drive);
|
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 {
|
} else {
|
||||||
temperature.Value = temperature.Value;
|
temperature.Value = temperature.Value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user