diff --git a/backend/src/chat/chat.service.ts b/backend/src/chat/chat.service.ts index 94084594..da5d4368 100644 --- a/backend/src/chat/chat.service.ts +++ b/backend/src/chat/chat.service.ts @@ -215,7 +215,7 @@ export class ChatService { const emitData = { userId: this.getUserId(client), status: UserStatus.Offline, - name: this.getUser(client).name, + name: this.getUser(client)?.name, }; if (emitData.userId) { client.broadcast.emit('online-status', [emitData]);