summaryrefslogtreecommitdiff
path: root/src/utils/glxhelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/glxhelper.cpp')
-rw-r--r--src/utils/glxhelper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/glxhelper.cpp b/src/utils/glxhelper.cpp
index 40f2b6f9f..42ac8ccb5 100644
--- a/src/utils/glxhelper.cpp
+++ b/src/utils/glxhelper.cpp
@@ -48,6 +48,8 @@ void *GlxHelper::createContext(const unsigned long window,
XSync(display, false);
int (*handler)(Display *, XErrorEvent *) = XSetErrorHandler(ErrorHandler);
void *context = mglXGetCurrentContext();
+ if (!display)
+ return context;
if (isGLNull(mglXGetCurrentContext)
|| isGLNull(mglXCreateContextAttribs)
|| isGLNull(mglXChooseFBConfig))
@@ -124,6 +126,8 @@ bool GlxHelper::makeCurrent(const unsigned long window,
void *const display,
void *const context)
{
+ if (!display)
+ return false;
return mglXMakeCurrent(static_cast<Display*>(display), window, context);
}