summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index 742669e..45b7a91 100644
--- a/main.c
+++ b/main.c
@@ -222,7 +222,12 @@ int main(int argc, const char **argv) {
}
state.display = wl_display_connect(NULL);
- assert(state.display);
+ if (!state.display) {
+ wlr_log(WLR_ERROR, "Unable to connect to the compositor. "
+ "If your compositor is running, check or set the "
+ "WAYLAND_DISPLAY environment variable.");
+ return 1;
+ }
struct wl_registry *registry = wl_display_get_registry(state.display);
wl_registry_add_listener(registry, &registry_listener, &state);