Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added handling of NULL as input for SDL_GameControllerMapping().
For consistency with the similar functions getting SDL_GameController as input.
Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
  • Loading branch information
philippwiesemann committed Oct 26, 2014
1 parent 90387da commit 30d6cec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -746,6 +746,10 @@ SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
char *
SDL_GameControllerMapping(SDL_GameController * gamecontroller)
{
if (!gamecontroller) {
return NULL;
}

return SDL_GameControllerMappingForGUID(gamecontroller->mapping.guid);
}

Expand Down

0 comments on commit 30d6cec

Please sign in to comment.