SDL_JoystickGetAttached() doesn't need to be noisy for NULL joystick Fixes https://github.com/libsdl-org/SDL/issues/5008
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;
}