From 2d06cfefbb0b94a057aec2f9b3098ad9f6b7fceb Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 18 Apr 2023 21:56:33 +0530 Subject: [PATCH] Event may not have some properties So use optional chaining here --- src/matrix/verification/SAS/channel/RoomChannel.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/matrix/verification/SAS/channel/RoomChannel.ts b/src/matrix/verification/SAS/channel/RoomChannel.ts index f0b7f1d0..482e3753 100644 --- a/src/matrix/verification/SAS/channel/RoomChannel.ts +++ b/src/matrix/verification/SAS/channel/RoomChannel.ts @@ -145,13 +145,14 @@ export class RoomChannel extends Disposables implements IChannel { } private async handleRoomMessage(entry: EventEntry) { - const type = entry.content.msgtype ?? entry.eventType; - if (!type.startsWith("m.key.verification") || entry.sender === this.ourUserId) { + const type = entry.content?.msgtype ?? entry.eventType; + if (!type?.startsWith("m.key.verification") || + entry.sender === this.ourUserId || + entry.isLoadedFromStorage) { return; } console.log("entry", entry); await this.log.wrap("RoomChannel.handleRoomMessage", async (log) => { - console.log("entry", entry); log.log({ l: "entry", entry }); if (!this.id) { throw new Error("Couldn't find event-id of request message!");