From 11eebe3e49b34365f71dc1227150114c374a272d Mon Sep 17 00:00:00 2001 From: swd Date: Sat, 31 Oct 2015 23:22:15 +0900 Subject: [PATCH] null check Append a code to check a null, because when window is null, it cause an error. --- src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.c b/src/context.c index 36840e55a..73a0c7774 100644 --- a/src/context.c +++ b/src/context.c @@ -543,7 +543,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle) _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); return;