SDL: Added NULL pointer check (825ff)

From 825ffaa168d6e89c76f3b74a15e5167082e1ab80 Mon Sep 17 00:00:00 2001
From: APGR22 <[EMAIL REDACTED]>
Date: Fri, 17 May 2024 21:05:40 +0700
Subject: [PATCH] Added NULL pointer check

(cherry picked from commit 961488b0dc992365adcc7f9c668da5e62afa3e00)
(cherry picked from commit e4fc07cad074fade6182bbf9ca5e9df0ae785f95)
---
 src/SDL_hints.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/SDL_hints.c b/src/SDL_hints.c
index ae4055d3252bd..2455cc13a1b61 100644
--- a/src/SDL_hints.c
+++ b/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) {