don't assume we have a timeline

This commit is contained in:
Bruno Windels 2020-09-04 16:27:39 +02:00
parent 9b771120e4
commit 1af118a443

View file

@ -92,9 +92,11 @@ export class Room extends EventEmitter {
this._roomEncryption = this._createRoomEncryption(this, encryptionParams); this._roomEncryption = this._createRoomEncryption(this, encryptionParams);
if (this._roomEncryption) { if (this._roomEncryption) {
this._sendQueue.enableEncryption(this._roomEncryption); this._sendQueue.enableEncryption(this._roomEncryption);
if (this._timeline) {
this._timeline.enableEncryption(this._decryptEntries.bind(this)); this._timeline.enableEncryption(this._decryptEntries.bind(this));
} }
} }
}
async _decryptEntry(entry, txn, isSync) { async _decryptEntry(entry, txn, isSync) {
if (entry.eventType === "m.room.encrypted") { if (entry.eventType === "m.room.encrypted") {