From 57fb350cfe1ab1191e611e510d90ecebc476e6a4 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 13 Oct 2023 19:37:07 -0700 Subject: [PATCH] Add null seat pointer checks --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index b123cc5..7649a85 100644 --- a/src/main.c +++ b/src/main.c @@ -542,7 +542,7 @@ static void client_info(const struct ctl_server_client* client_handle, info->id = client->id; info->hostname = nvnc_client_get_hostname(vnc_client); info->username = nvnc_client_get_auth_username(vnc_client); - info->seat = client->seat->name; + info->seat = client->seat ? client->seat->name : NULL; } static int get_output_list(struct ctl* ctl, @@ -1113,7 +1113,7 @@ static void client_destroy(void* obj) .id = self->id, .hostname = nvnc_client_get_hostname(self->nvnc_client), .username = nvnc_client_get_auth_username(self->nvnc_client), - .seat = self->seat->name, + .seat = self->seat ? self->seat->name : NULL, }; ctl_server_event_disconnected(wayvnc->ctl, &info, wayvnc->nr_clients); @@ -1161,7 +1161,7 @@ static void on_nvnc_client_new(struct nvnc_client* client) .id = wayvnc_client->id, .hostname = nvnc_client_get_hostname(client), .username = nvnc_client_get_auth_username(client), - .seat = wayvnc_client->seat->name, + .seat = wayvnc_client->seat ? wayvnc_client->seat->name : NULL, }; ctl_server_event_connected(self->ctl, &info, self->nr_clients);