fix segfault crash when DISPLAY is empty (getenv returned null pointer)

This commit is contained in:
don bright 2016-09-02 22:05:01 -05:00
parent 77782d24f6
commit 67170488ef

View file

@ -266,7 +266,9 @@ bool create_glx_dummy_window(OffscreenContext &ctx)
ctx.xdisplay = XOpenDisplay(NULL);
if (ctx.xdisplay == NULL) {
cerr << "Unable to open a connection to the X server (DISPLAY=" << getenv("DISPLAY") << ")\n";
cerr << "Unable to open a connection to the X server.\n";
char * dpyenv = getenv("DISPLAY");
cerr << "DISPLAY=" << (dpyenv?dpyenv:"") << "\n";
return false;
}