mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-06 01:46:25 +00:00
darwin: Don't pass NULL device refs to IOHIDDeviceGetValue().
Possibly fixes Bugzilla #4961.
This commit is contained in:
@@ -161,7 +161,7 @@ GetHIDElementState(recDevice *pDevice, recElement *pElement, SInt32 *pValue)
|
|||||||
SInt32 value = 0;
|
SInt32 value = 0;
|
||||||
int returnValue = SDL_FALSE;
|
int returnValue = SDL_FALSE;
|
||||||
|
|
||||||
if (pDevice && pElement) {
|
if (pDevice && pDevice->deviceRef && pElement) {
|
||||||
IOHIDValueRef valueRef;
|
IOHIDValueRef valueRef;
|
||||||
if (IOHIDDeviceGetValue(pDevice->deviceRef, pElement->elementRef, &valueRef) == kIOReturnSuccess) {
|
if (IOHIDDeviceGetValue(pDevice->deviceRef, pElement->elementRef, &valueRef) == kIOReturnSuccess) {
|
||||||
value = (SInt32) IOHIDValueGetIntegerValue(valueRef);
|
value = (SInt32) IOHIDValueGetIntegerValue(valueRef);
|
||||||
|
Reference in New Issue
Block a user