1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Merge pull request #847 from matrix-org/travis/fix-megolm-error

Fix "e is undefined" masking the original error in MegolmDecryption
This commit is contained in:
Travis Ralston
2019-02-26 13:59:16 -07:00
committed by GitHub

View File

@@ -758,7 +758,7 @@ MegolmDecryption.prototype.decryptEvent = async function(event) {
} catch (e) { } catch (e) {
let errorCode = "OLM_DECRYPT_GROUP_MESSAGE_ERROR"; let errorCode = "OLM_DECRYPT_GROUP_MESSAGE_ERROR";
if (e.message === 'OLM.UNKNOWN_MESSAGE_INDEX') { if (e && e.message === 'OLM.UNKNOWN_MESSAGE_INDEX') {
this._requestKeysForEvent(event); this._requestKeysForEvent(event);
errorCode = 'OLM_UNKNOWN_MESSAGE_INDEX'; errorCode = 'OLM_UNKNOWN_MESSAGE_INDEX';
@@ -766,7 +766,7 @@ MegolmDecryption.prototype.decryptEvent = async function(event) {
throw new base.DecryptionError( throw new base.DecryptionError(
errorCode, errorCode,
e.toString(), { e ? e.toString() : "Unknown Error: Error is undefined", {
session: content.sender_key + '|' + content.session_id, session: content.sender_key + '|' + content.session_id,
}, },
); );