summaryrefslogtreecommitdiff
diff options
-rw-r--r--liblightdm-gobject/layout.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/liblightdm-gobject/layout.c b/liblightdm-gobject/layout.c
index d0792101..daa4278a 100644
--- a/liblightdm-gobject/layout.c
+++ b/liblightdm-gobject/layout.c
@@ -116,6 +116,9 @@ lightdm_get_layouts (void)
return layouts;
display = XOpenDisplay (NULL);
+ if (display == NULL)
+ return NULL;
+
xkl_engine = xkl_engine_get_instance (display);
xkl_config = xkl_config_rec_new ();
if (!xkl_config_rec_get_from_server (xkl_config, xkl_engine))