module/xwindow: replace assert with real error check

This commit is contained in:
Daniel Eklöf 2018-12-26 11:44:21 +01:00
parent 6d75fe64ef
commit 3af0280304

View file

@ -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;