From 3af02803048d47b6c4716ba961dba077e962903a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 26 Dec 2018 11:44:21 +0100 Subject: [PATCH] module/xwindow: replace assert with real error check --- modules/xwindow/xwindow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/xwindow/xwindow.c b/modules/xwindow/xwindow.c index c324f17..ed42962 100644 --- a/modules/xwindow/xwindow.c +++ b/modules/xwindow/xwindow.c @@ -181,7 +181,11 @@ run(struct module_run_context *ctx) struct private *m = mod->private; m->conn = xcb_connect(NULL, NULL); - assert(m->conn != NULL); + if (m->conn == NULL) { + LOG_ERR("failed to connect to X"); + module_signal_ready(ctx); + return 1; + } const xcb_setup_t *setup = xcb_get_setup(m->conn); xcb_screen_t *screen = xcb_setup_roots_iterator(setup).data;