Skip to content

Commit

Permalink
glfwGetJoystickName() on invalid joysticks, return null
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshinm committed May 5, 2017
1 parent 45f66b3 commit 2d0032e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/library_glfw.js
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,11 @@ var LibraryGLFW = {
},

glfwGetJoystickName: function(joy) {
return GLFW.active.joys[joy].id;
if (GLFW.active.joys[joy]) {
return GLFW.active.joys[joy].id;
} else {
return 0;
}
},

glfwSetJoystickCallback: function(cbfun) {
Expand Down

0 comments on commit 2d0032e

Please sign in to comment.