From d80bc2e2956d4192c4d21495c34a1e2b3329b9d0 Mon Sep 17 00:00:00 2001 From: icleitoncosta Date: Tue, 9 Apr 2024 12:29:00 -0300 Subject: [PATCH] fix: Fixed fromMe is undefined --- src/chat/events/registerNewMessageEvent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/events/registerNewMessageEvent.ts b/src/chat/events/registerNewMessageEvent.ts index 44ce4eb277..ea3d1b6239 100644 --- a/src/chat/events/registerNewMessageEvent.ts +++ b/src/chat/events/registerNewMessageEvent.ts @@ -42,7 +42,7 @@ function register() { if (typeof MsgModel.prototype.chat === 'undefined') { Object.defineProperty(MsgModel.prototype, 'chat', { get: function () { - return ChatStore.get(this.id.fromMe ? this.to : this.from); + return ChatStore.get(this.id?.fromMe ? this.to : this.from); }, configurable: true, });