Skip to content

Commit

Permalink
Added handling of NULL as input for SDL_GameControllerAddMapping().
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Oct 26, 2014
1 parent 33a2b58 commit 7268eab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -669,6 +669,10 @@ SDL_GameControllerAddMapping(const char *mappingString)
ControllerMapping_t *pControllerMapping;
SDL_bool is_xinput_mapping = SDL_FALSE;

if (!mappingString) {
return SDL_InvalidParamError("mappingString");
}

pchGUID = SDL_PrivateGetControllerGUIDFromMappingString(mappingString);
if (!pchGUID) {
return SDL_SetError("Couldn't parse GUID from %s", mappingString);
Expand Down

0 comments on commit 7268eab

Please sign in to comment.