Commit d861820465b3ae77fa37fb3605ca73100320d1ff

Sam Lantinga 2021-11-26T07:57:19

SDL_JoystickGetAttached() doesn't need to be noisy for NULL joystick Fixes https://github.com/libsdl-org/SDL/issues/5008

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 95f241b..e94a8aa 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -759,7 +759,7 @@ SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
 SDL_bool
 SDL_JoystickGetAttached(SDL_Joystick *joystick)
 {
-    if (!SDL_PrivateJoystickValid(joystick)) {
+    if (!joystick) {
         return SDL_FALSE;
     }