mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 11:05:03 +01:00
Event may not have some properties
So use optional chaining here
This commit is contained in:
parent
85ede8a753
commit
2d06cfefbb
@ -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!");
|
||||
|
Loading…
Reference in New Issue
Block a user