From 41e59efa7268acea77f9546dcb53397e1303f55b Mon Sep 17 00:00:00 2001 From: Guilherme Mascarenhas <37594431+guicuton@users.noreply.github.com> Date: Mon, 7 Aug 2023 12:57:23 -0300 Subject: [PATCH] fix: Client.getChatById(): Cannot read properties of undefined (reading '_serialized') (#2225) * fix: Cannot read properties of undefined (reading '_serialized') * Update supported WhatsApp Web version to v2.2321.6 * Revert "Update WhatsApp Web Version (2.2321.6)" --------- Co-authored-by: guicuton Co-authored-by: Rajeh Taher Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com> --- src/util/Injected.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/Injected.js b/src/util/Injected.js index 86d56ed..da8fb2f 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -475,7 +475,7 @@ exports.LoadUtils = () => { res.lastMessage = null; if (res.msgs && res.msgs.length) { - const lastMessage = window.Store.Msg.get(chat.lastReceivedKey._serialized); + const lastMessage = chat.lastReceivedKey ? window.Store.Msg.get(chat.lastReceivedKey._serialized) : null; if (lastMessage) { res.lastMessage = window.WWebJS.getMessageModel(lastMessage); }