Fix NULL pointer dereference

Calling glfwMakeContextCurrent with NULL would segfault since
496f559c9a.

Fixes #631.
Closes #632.
master
Camilla Berglund ago%!(EXTRA string=10 years)
parent 3489b759a0
commit 6a41d5e7ad
  1. 2
      src/context.c

@ -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;

Loading…
Cancel
Save