From 22b526c4f58ae16a1d57e809e0732c174acda155 Mon Sep 17 00:00:00 2001 From: David Silva Date: Tue, 25 Jun 2024 01:09:44 -0300 Subject: [PATCH] fix: cannot read properties of undefined --- src/providers/user.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/user.service.ts b/src/providers/user.service.ts index ad899e1..49d7e67 100644 --- a/src/providers/user.service.ts +++ b/src/providers/user.service.ts @@ -67,7 +67,7 @@ export class UserService { async setToOffline(request: Request) { const user: User = request['user']; const jobs = await this.onlineUsersQueue.getWaiting(); - const onlineUser = jobs.find((job) => job.data === user.username); + const onlineUser = jobs.find((job) => job?.data === user.username); return await onlineUser .remove()