Browse Source

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

Sam Lantinga 1 year ago
parent
commit
1b86a1c684
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/joystick/SDL_gamepad.c

+ 4 - 3
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;
 }