Do not try to register device when device description is empty.

This commit is contained in:
the_fiddler 2010-12-03 12:29:01 +00:00
parent 223c911bf9
commit 140a278b3e

View file

@ -103,7 +103,16 @@ namespace OpenTK.Platform.Windows
RegistryKey regkey = GetRegistryKey(name);
string deviceDesc = (string)regkey.GetValue("DeviceDesc");
string deviceClass = (string)regkey.GetValue("Class");
deviceDesc = deviceDesc.Substring(deviceDesc.LastIndexOf(';') + 1);
if (String.IsNullOrEmpty(deviceDesc))
{
Debug.Print("[Warning] Failed to retrieve device description, skipping this device.");
continue;
}
else
{
deviceDesc = deviceDesc.Substring(deviceDesc.LastIndexOf(';') + 1);
}
if (!String.IsNullOrEmpty(deviceClass) && deviceClass.ToLower().Equals("keyboard"))
{