SDL: SDL_GetGamepadAppleSFSymbolsNameForAxis() returns NULL if the symbol isn't found

From 1b86a1c684350b68569b908faa9693aa7aa227eb Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 3 Mar 2024 11:55:40 -0800
Subject: [PATCH] SDL_GetGamepadAppleSFSymbolsNameForAxis() returns NULL if the
 symbol isn't found

---
 src/joystick/SDL_gamepad.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c
index e7f55880c25e..7b27ec299067 100644
--- a/src/joystick/SDL_gamepad.c
+++ b/src/joystick/SDL_gamepad.c
@@ -3771,8 +3771,9 @@ const char *SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_Ga
     }
     SDL_UnlockJoysticks();
 
-    return retval;
-#else
-    return NULL;
+    if (retval && *retval) {
+        return retval;
+    }
 #endif
+    return NULL;
 }