Fix NullPointerException on Windows 8.
This commit is contained in:
parent
d1713ff47a
commit
af74d97903
1 changed files with 1 additions and 1 deletions
|
@ -108,7 +108,7 @@ namespace OpenTK.Platform.Windows
|
||||||
string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); // for windows 8 support via OpenTK issue 3198
|
string deviceClassGUID = (string)regkey.GetValue("ClassGUID"); // for windows 8 support via OpenTK issue 3198
|
||||||
|
|
||||||
// making a guess at backwards compatability. Not sure what older windows returns in these cases...
|
// making a guess at backwards compatability. Not sure what older windows returns in these cases...
|
||||||
if(deviceClass != null || deviceClass.Equals(string.Empty)){
|
if(deviceClass == null || deviceClass.Equals(string.Empty)){
|
||||||
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID);
|
RegistryKey classGUIDKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + deviceClassGUID);
|
||||||
deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty;
|
deviceClass = classGUIDKey != null ? (string) classGUIDKey.GetValue("Class") : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue