From 1591350144b60d1b6e5e043a021eb90fc26bdb32 Mon Sep 17 00:00:00 2001 From: Matheus Kuster Date: Sun, 15 Sep 2024 06:30:21 -0300 Subject: [PATCH] chore: add typecheck to data.from and data.to when creating the inviteV4 (#3257) Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com> --- src/structures/Message.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index 3b3f8ca..6013063 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -182,8 +182,8 @@ class Message extends Base { inviteCodeExp: data.inviteCodeExp, groupId: data.inviteGrp, groupName: data.inviteGrpName, - fromId: '_serialized' in data.from ? data.from._serialized : data.from, - toId: '_serialized' in data.to ? data.to._serialized : data.to + fromId: typeof data.from === 'object' && '_serialized' in data.from ? data.from._serialized : data.from, + toId: typeof data.to === 'object' && '_serialized' in data.to ? data.to._serialized : data.to } : undefined; /**