From 151f1600e76ca9de7a068065fc74c40b7973e352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Sun, 25 Apr 2010 13:16:28 +0000 Subject: [PATCH] Fixed a NullReferenceException in HDD.Update. --- Hardware/HDD/HDD.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Hardware/HDD/HDD.cs b/Hardware/HDD/HDD.cs index 5f78d58..e5f6167 100644 --- a/Hardware/HDD/HDD.cs +++ b/Hardware/HDD/HDD.cs @@ -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; }