Fix NULL pointer dereference

Calling glfwMakeContextCurrent with NULL would segfault since
496f559c9a.

Fixes #631.
Closes #632.
This commit is contained in:
Camilla Berglund 2015-10-31 18:21:21 +01:00
parent 3489b759a0
commit 6a41d5e7ad

View File

@ -543,7 +543,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
_GLFW_REQUIRE_INIT();
if (window->context.api == GLFW_NO_API)
if (window && window->context.api == GLFW_NO_API)
{
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
return;