From 0d040611e7c3c97b34a50fd4c809da664e7326e9 Mon Sep 17 00:00:00 2001 From: alechkos <93551621+alechkos@users.noreply.github.com> Date: Fri, 30 May 2025 15:50:02 +0300 Subject: [PATCH] fix: remove serialization on already deserialized object (#3350) --- src/structures/Broadcast.js | 2 +- src/util/Injected/Utils.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/structures/Broadcast.js b/src/structures/Broadcast.js index eb7f977..b74483b 100644 --- a/src/structures/Broadcast.js +++ b/src/structures/Broadcast.js @@ -43,7 +43,7 @@ class Broadcast extends Base { * Messages statuses * @type {Message[]} */ - this.msgs = data.msgs.map(msg => new Message(this.client, msg)); + this.msgs = data.msgs?.map(msg => new Message(this.client, msg)); return super._patch(data); } diff --git a/src/util/Injected/Utils.js b/src/util/Injected/Utils.js index e69208a..4f91ae0 100644 --- a/src/util/Injected/Utils.js +++ b/src/util/Injected/Utils.js @@ -1021,9 +1021,8 @@ exports.LoadUtils = () => { }; window.WWebJS.getStatusModel = status => { - let res = status.serialize(); + const res = status.serialize(); delete res._msgs; - res.msgs = status._msgs.map(msg => window.WWebJS.getMessageModel(msg)); return res; };