Browse Source

libobs: Null check hotkey device on macos

Colin Edwards 5 years ago
parent
commit
fbacd74cd1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      libobs/obs-cocoa.m

+ 4 - 0
libobs/obs-cocoa.m

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