mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 21:14:10 +01:00
Fix null deref in server_init
If the backend fails to be created, log an error and immidiately return from server_init.
This commit is contained in:
parent
7d707e6865
commit
4ebd6f3507
@ -48,6 +48,10 @@ bool server_init(struct sway_server *server) {
|
|||||||
server->wl_event_loop = wl_display_get_event_loop(server->wl_display);
|
server->wl_event_loop = wl_display_get_event_loop(server->wl_display);
|
||||||
server->backend = wlr_backend_autocreate(server->wl_display);
|
server->backend = wlr_backend_autocreate(server->wl_display);
|
||||||
|
|
||||||
|
if (!server->backend) {
|
||||||
|
wlr_log(L_ERROR, "Unable to create backend");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend);
|
struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend);
|
||||||
assert(renderer);
|
assert(renderer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user