Skip to content

Commit

Permalink
Check for NULL joystick in SDL_JoystickGetGUID()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 6, 2013
1 parent 90a219a commit 8f46bcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/joystick/SDL_joystick.c
Expand Up @@ -763,6 +763,11 @@ SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index)
/* return the guid for this opened device */
SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick)
{
if (!SDL_PrivateJoystickValid(joystick)) {
SDL_JoystickGUID emptyGUID;
SDL_zero( emptyGUID );
return emptyGUID;
}
return SDL_SYS_JoystickGetGUID( joystick );
}

Expand Down

0 comments on commit 8f46bcf

Please sign in to comment.