# HG changeset patch # User moel.mich # Date 1264615971 0 # Node ID 105939e4eb7e0703623fbf383f5048f227e4fa2f # Parent 361e324a0ed4bbc6713cb21ca1a7f9fae588d806 Fixed a NullReferenceException in the HDD SMART code. diff -r 361e324a0ed4 -r 105939e4eb7e GUI/MainForm.cs --- a/GUI/MainForm.cs Tue Jan 26 22:37:48 2010 +0000 +++ b/GUI/MainForm.cs Wed Jan 27 18:12:51 2010 +0000 @@ -126,7 +126,7 @@ minMenuItem.Checked = Utilities.Config.Get(minMenuItem.Name, false); maxMenuItem.Checked = Utilities.Config.Get(maxMenuItem.Name, true); limitMenuItem.Checked = Utilities.Config.Get(limitMenuItem.Name, false); - hddMenuItem.Checked = Utilities.Config.Get(hddMenuItem.Name, false); + hddMenuItem.Checked = Utilities.Config.Get(hddMenuItem.Name, true); voltMenuItem.Checked = Utilities.Config.Get(voltMenuItem.Name, true); clocksMenuItem.Checked = Utilities.Config.Get(clocksMenuItem.Name, true); diff -r 361e324a0ed4 -r 105939e4eb7e Hardware/HDD/HDDGroup.cs --- a/Hardware/HDD/HDDGroup.cs Tue Jan 26 22:37:48 2010 +0000 +++ b/Hardware/HDD/HDDGroup.cs Wed Jan 27 18:12:51 2010 +0000 @@ -60,9 +60,12 @@ string name = SMART.ReadName(handle, drive); if (name != null) { - SMART.DriveAttribute[] attributes = + SMART.DriveAttribute[] attributes = SMART.ReadSmart(handle, drive); + if (attributes == null) + continue; + int attribute = -1; for (int i = 0; i < attributes.Length; i++) { if (attributes[i].ID == SMART.AttributeID.Temperature) {