Fixed the following NullReferenceException:
authormoel.mich
Sat, 15 May 2010 11:20:50 +0000
changeset 11503d3325e85d4
parent 114 69dfa910e628
child 116 c92e98bc2073
Fixed the following NullReferenceException:
System.NullReferenceException:
in OpenHardwareMonitor.Hardware.Nvidia.NvidiaGroup..ctor()
in OpenHardwareMonitor.Hardware.Computer.Open()
in OpenHardwareMonitor.GUI.MainForm..ctor()
in OpenHardwareMonitor.Program.Main()
Hardware/Nvidia/NvidiaGroup.cs
     1.1 --- a/Hardware/Nvidia/NvidiaGroup.cs	Sat May 15 11:09:02 2010 +0000
     1.2 +++ b/Hardware/Nvidia/NvidiaGroup.cs	Sat May 15 11:20:50 2010 +0000
     1.3 @@ -55,7 +55,13 @@
     1.4  
     1.5        NvPhysicalGpuHandle[] handles = 
     1.6          new NvPhysicalGpuHandle[NVAPI.MAX_PHYSICAL_GPUS];
     1.7 -  
     1.8 +
     1.9 +      if (NVAPI.NvAPI_EnumPhysicalGPUs == null) {
    1.10 +        report.AppendLine("Error: NvAPI_EnumPhysicalGPUs not available");
    1.11 +        report.AppendLine();
    1.12 +        return;
    1.13 +      }
    1.14 +
    1.15        int count;
    1.16        if (NVAPI.NvAPI_EnumPhysicalGPUs(handles, out count) != NvStatus.OK)
    1.17          return;