diff --git a/src/crypto/algorithms/base.js b/src/crypto/algorithms/base.js index bcf536fa2..685332085 100644 --- a/src/crypto/algorithms/base.js +++ b/src/crypto/algorithms/base.js @@ -169,7 +169,7 @@ utils.inherits(DecryptionError, Error); * @returns {String} */ DecryptionError.prototype.toString = function() { - let result = this.name + '[msg: '+ this.message; + let result = this.name + '[msg: ' + this.message; if (this.details) { result += ', ' + diff --git a/src/crypto/algorithms/megolm.js b/src/crypto/algorithms/megolm.js index f3a76eb1b..f7d7b770e 100644 --- a/src/crypto/algorithms/megolm.js +++ b/src/crypto/algorithms/megolm.js @@ -606,10 +606,13 @@ MegolmDecryption.prototype.onRoomKeyEvent = function(event) { if (!content.room_id || !sessionId || - !content.session_key || - !senderKey + !content.session_key ) { - console.error(`key event is missing fields`); + console.error("key event is missing fields"); + return; + } + if (!senderKey) { + console.error("key event has no sender key (not encrypted?)"); return; }