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 <guicuton@users.noreply.github.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com>
This commit is contained in:
Guilherme Mascarenhas 2023-08-07 12:57:23 -03:00 • committed by GitHub
commit 41e59efa72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}