diff options
author | sr55 <[email protected]> | 2013-10-06 14:01:10 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-10-06 14:01:10 +0000 |
commit | c663cbbc45fbdeb48e81c12ab32b3642cb1e2b6a (patch) | |
tree | 4217ba931f5e5feaf3fd0cbfe153b8dd4c7c8e13 /win | |
parent | 5d144986e7f6f42038a2398ea661a7449e0b3c46 (diff) |
WinGui: Add some sanity checks around the Gpu Info checker.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5823 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs index af4a57bcd..2ea664f1a 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs @@ -129,21 +129,26 @@ namespace HandBrake.ApplicationServices.Utilities List<string> gpuInfo = new List<string>();
ManagementObjectSearcher searcher = new ManagementObjectSearcher(
"select * from " + "Win32_VideoController");
+
foreach (ManagementObject share in searcher.Get())
{
string gpu = string.Empty, version = string.Empty;
foreach (PropertyData PC in share.Properties)
{
- if (PC.Name.Equals("DriverVersion")) version = PC.Value.ToString();
-
-
- if (PC.Name.Equals("Name"))
- gpu = PC.Value.ToString();
+ if (!string.IsNullOrEmpty(PC.Name) && PC.Value != null)
+ {
+ if (PC.Name.Equals("DriverVersion")) version = PC.Value.ToString();
+ if (PC.Name.Equals("Name")) gpu = PC.Value.ToString();
+ }
}
- gpuInfo.Add(string.Format("{0} - {1}", gpu, version));
+ if (!string.IsNullOrEmpty(gpu) && !string.IsNullOrEmpty(version))
+ {
+ gpuInfo.Add(string.Format("{0} - {1}", gpu, version));
+ }
}
+
return gpuInfo;
}
}
|