diff options
Diffstat (limited to 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index f2015a05..3f0fc867 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -31,7 +31,9 @@ void sway_terminate(int exit_code) { | |||
31 | window_teardown(window); | 31 | window_teardown(window); |
32 | } | 32 | } |
33 | list_free(surfaces); | 33 | list_free(surfaces); |
34 | registry_teardown(registry); | 34 | if (registry) { |
35 | registry_teardown(registry); | ||
36 | } | ||
35 | exit(exit_code); | 37 | exit(exit_code); |
36 | } | 38 | } |
37 | 39 | ||
@@ -292,6 +294,10 @@ int main(int argc, char **argv) { | |||
292 | surfaces = create_list(); | 294 | surfaces = create_list(); |
293 | registry = registry_poll(); | 295 | registry = registry_poll(); |
294 | 296 | ||
297 | if (!registry) { | ||
298 | sway_abort("Unable to connect to wayland compositor"); | ||
299 | } | ||
300 | |||
295 | if (!registry->swaylock) { | 301 | if (!registry->swaylock) { |
296 | sway_abort("swaylock requires the compositor to support the swaylock extension."); | 302 | sway_abort("swaylock requires the compositor to support the swaylock extension."); |
297 | } | 303 | } |