Added handling of NULL as input for SDL_GameControllerMapping().
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 26 Oct 2014 17:53:16 +0100
changeset 91963c3a84b56da0
parent 9195 e390d259582b
child 9197 90bb83c49dea
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.
src/joystick/SDL_gamecontroller.c
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Sun Oct 26 17:46:11 2014 +0100
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Sun Oct 26 17:53:16 2014 +0100
     1.3 @@ -746,6 +746,10 @@
     1.4  char *
     1.5  SDL_GameControllerMapping(SDL_GameController * gamecontroller)
     1.6  {
     1.7 +    if (!gamecontroller) {
     1.8 +        return NULL;
     1.9 +    }
    1.10 +
    1.11      return SDL_GameControllerMappingForGUID(gamecontroller->mapping.guid);
    1.12  }
    1.13