From 8f9fc786328b91b2f7e913699e553616f60f35e5 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Wed, 20 Jun 2018 10:05:21 +0200 Subject: [PATCH] display: Fix X11 crash when DISPLAY unset. --- display/x11.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/display/x11.c b/display/x11.c index 7d83c437..cb89deb6 100644 --- a/display/x11.c +++ b/display/x11.c @@ -272,6 +272,10 @@ ws_init(const char *crtname, /* crt type name */ xpixels = xp; /* save screen size */ ypixels = yp; + if (getenv ("DISPLAY") == NULL) { + return 0; + } + XtToolkitInitialize(); app_context = XtCreateApplicationContext(); argc = 0;