Fixed a NullReferenceException in the HDD SMART code.
authormoel.mich
Wed, 27 Jan 2010 18:12:51 +0000
changeset 2105939e4eb7e
parent 1 361e324a0ed4
child 3 1a0928afac6b
Fixed a NullReferenceException in the HDD SMART code.
GUI/MainForm.cs
Hardware/HDD/HDDGroup.cs
     1.1 --- a/GUI/MainForm.cs	Tue Jan 26 22:37:48 2010 +0000
     1.2 +++ b/GUI/MainForm.cs	Wed Jan 27 18:12:51 2010 +0000
     1.3 @@ -126,7 +126,7 @@
     1.4        minMenuItem.Checked = Utilities.Config.Get(minMenuItem.Name, false);
     1.5        maxMenuItem.Checked = Utilities.Config.Get(maxMenuItem.Name, true);
     1.6        limitMenuItem.Checked = Utilities.Config.Get(limitMenuItem.Name, false);
     1.7 -      hddMenuItem.Checked = Utilities.Config.Get(hddMenuItem.Name, false);
     1.8 +      hddMenuItem.Checked = Utilities.Config.Get(hddMenuItem.Name, true);
     1.9  
    1.10        voltMenuItem.Checked = Utilities.Config.Get(voltMenuItem.Name, true);
    1.11        clocksMenuItem.Checked = Utilities.Config.Get(clocksMenuItem.Name, true);
     2.1 --- a/Hardware/HDD/HDDGroup.cs	Tue Jan 26 22:37:48 2010 +0000
     2.2 +++ b/Hardware/HDD/HDDGroup.cs	Wed Jan 27 18:12:51 2010 +0000
     2.3 @@ -60,9 +60,12 @@
     2.4              string name = SMART.ReadName(handle, drive);
     2.5              if (name != null) {
     2.6  
     2.7 -              SMART.DriveAttribute[] attributes =
     2.8 +              SMART.DriveAttribute[] attributes = 
     2.9                  SMART.ReadSmart(handle, drive);
    2.10  
    2.11 +              if (attributes == null)
    2.12 +                continue;
    2.13 +
    2.14                int attribute = -1;
    2.15                for (int i = 0; i < attributes.Length; i++) {
    2.16                  if (attributes[i].ID == SMART.AttributeID.Temperature) {