mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-17 14:47:19 +01:00
Check for NULL joystick in SDL_JoystickGetGUID()
This commit is contained in:
parent
90a219a375
commit
8f46bcfd6d
@ -763,6 +763,11 @@ SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
|
|||||||
/* return the guid for this opened device */
|
/* return the guid for this opened device */
|
||||||
SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)
|
SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)
|
||||||
{
|
{
|
||||||
|
if (!SDL_PrivateJoystickValid(joystick)) {
|
||||||
|
SDL_JoystickGUID emptyGUID;
|
||||||
|
SDL_zero( emptyGUID );
|
||||||
|
return emptyGUID;
|
||||||
|
}
|
||||||
return SDL_SYS_JoystickGetGUID( joystick );
|
return SDL_SYS_JoystickGetGUID( joystick );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user