diff --git a/src/util/entities/Session.ts b/src/util/entities/Session.ts index 4ff9e10c5..d1b31b1db 100644 --- a/src/util/entities/Session.ts +++ b/src/util/entities/Session.ts @@ -85,8 +85,8 @@ export class Session extends BaseClassWithoutId { id_hash: crypto.createHash("sha256").update(this.session_id).digest("hex"), approx_last_used_time: this.last_seen.toISOString(), client_info: { - os: this.client_info.os, - client: this.client_info.client, + os: this.client_info?.os, + client: this.client_info?.client, location: this.last_seen_location, }, }; @@ -101,7 +101,7 @@ export class Session extends BaseClassWithoutId { client_status: this.client_status, approx_last_used_time: this.last_seen.toISOString(), client_info: { - ...this.client_info, + ...this.client_info ?? {}, location: this.last_seen_location, }, last_seen: this.last_seen,