Browse Source

Added NULL pointer check

(cherry picked from commit 961488b0dc992365adcc7f9c668da5e62afa3e00)
(cherry picked from commit e4fc07cad074fade6182bbf9ca5e9df0ae785f95)
APGR22 11 months ago
parent
commit
825ffaa168
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/SDL_hints.c

+ 4 - 0
src/SDL_hints.c

@@ -161,6 +161,10 @@ const char *SDL_GetHint(const char *name)
     const char *env;
     SDL_Hint *hint;
 
+    if (!name) {
+        return NULL;
+    }
+
     env = SDL_getenv(name);
     for (hint = SDL_hints; hint; hint = hint->next) {
         if (SDL_strcmp(name, hint->name) == 0) {