Add null seat pointer checks

pull/268/head
Christopher Snowhill 2023-10-13 19:37:07 -07:00 committed by Andri Yngvason
parent 1c489ad8e9
commit 57fb350cfe
1 changed files with 3 additions and 3 deletions

View File

@ -542,7 +542,7 @@ static void client_info(const struct ctl_server_client* client_handle,
info->id = client->id; info->id = client->id;
info->hostname = nvnc_client_get_hostname(vnc_client); info->hostname = nvnc_client_get_hostname(vnc_client);
info->username = nvnc_client_get_auth_username(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, static int get_output_list(struct ctl* ctl,
@ -1113,7 +1113,7 @@ static void client_destroy(void* obj)
.id = self->id, .id = self->id,
.hostname = nvnc_client_get_hostname(self->nvnc_client), .hostname = nvnc_client_get_hostname(self->nvnc_client),
.username = nvnc_client_get_auth_username(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); 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, .id = wayvnc_client->id,
.hostname = nvnc_client_get_hostname(client), .hostname = nvnc_client_get_hostname(client),
.username = nvnc_client_get_auth_username(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); ctl_server_event_connected(self->ctl, &info, self->nr_clients);