null check

Append a code to check a null, because when window is null, it cause an error.
This commit is contained in:
swd 2015-10-31 23:22:15 +09:00
parent ba1f1f8ee9
commit 11eebe3e49

View File

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