Fix segfault if swaybg is run without Wayland

Mirrors a similar check in `swaylock/main.c`
This commit is contained in:
Nick Parker 2018-02-19 14:55:28 -08:00
parent ddc8000384
commit 6816253110
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ void sway_terminate(int exit_code) {
window_teardown(window);
}
list_free(surfaces);
registry_teardown(registry);
if (registry) {
registry_teardown(registry);
}
exit(exit_code);
}