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

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

Fixes https://github.com/libsdl-org/SDL/issues/9071
---
 src/joystick/SDL_gamecontroller.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index bce36ab150f58..0e2dbe14e2839 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -3259,10 +3259,11 @@ const char *SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController
     }
     SDL_UnlockJoysticks();
 
-    return retval;
-#else
-    return NULL;
+    if (retval && *retval) {
+        return retval;
+    }
 #endif
+    return NULL;
 }
 
 const char *SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)