From 875a1697924af99182412ff2f4748abfbd798dbf Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 8 Nov 2012 16:26:43 +0100 Subject: [PATCH] Added missing test for joystick presence. --- src/x11_joystick.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/x11_joystick.c b/src/x11_joystick.c index d9b0116b..230edcb4 100644 --- a/src/x11_joystick.c +++ b/src/x11_joystick.c @@ -340,6 +340,9 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, const char* _glfwPlatformGetJoystickName(int joy) { + if (!_glfwLibrary.X11.joystick[joy].present) + return NULL; + return _glfwLibrary.X11.joystick[joy].name; }