libobs: Null check hotkey device on macos

This commit is contained in:
Colin Edwards 2019-12-13 23:26:34 -06:00
parent 68bedcf1a9
commit 1819696198

View file

@ -1754,6 +1754,10 @@ bool obs_hotkeys_platform_is_pressed(obs_hotkeys_platform_t *plat,
IOHIDValueRef value = 0; IOHIDValueRef value = 0;
IOHIDDeviceRef device = IOHIDElementGetDevice(element); IOHIDDeviceRef device = IOHIDElementGetDevice(element);
if (device == NULL) {
continue;
}
if (IOHIDDeviceGetValue(device, element, &value) != if (IOHIDDeviceGetValue(device, element, &value) !=
kIOReturnSuccess) { kIOReturnSuccess) {
i += 1; i += 1;