Guard against a null result from HID code.
It seems strange that CFGetTypeID on null would crash, but the reports from users suggest this might be the case.
This commit is contained in:
parent
b0d707c3f4
commit
4db129cb01
1 changed files with 1 additions and 1 deletions
|
@ -265,7 +265,7 @@ void FGMacOSXEventInputPrivate::removedDevice(IOHIDDeviceRef device)
|
|||
std::string FGMacOSXEventInputPrivate::getDeviceStringProperty(IOHIDDeviceRef device, CFStringRef hidProp)
|
||||
{
|
||||
CFStringRef prop = (CFStringRef) IOHIDDeviceGetProperty(device, hidProp);
|
||||
if (CFGetTypeID(prop) != CFStringGetTypeID()) {
|
||||
if ((prop == nullptr)|| (CFGetTypeID(prop) != CFStringGetTypeID())) {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue