Added missing test for joystick presence.

This commit is contained in:
Camilla Berglund 2012-11-08 16:26:43 +01:00
parent 7eff6b1b1e
commit 875a169792

View File

@ -340,6 +340,9 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
const char* _glfwPlatformGetJoystickName(int joy) const char* _glfwPlatformGetJoystickName(int joy)
{ {
if (!_glfwLibrary.X11.joystick[joy].present)
return NULL;
return _glfwLibrary.X11.joystick[joy].name; return _glfwLibrary.X11.joystick[joy].name;
} }