Skip to content

Commit

Permalink
Merge pull request #1315 from matrix-org/bwindels/fixe2eecrash
Browse files Browse the repository at this point in the history
Fix e2ee crash after refreshing after having received a cross-singing key reset
  • Loading branch information
bwindels authored Apr 10, 2020
2 parents a686231 + 197d5eb commit 8992438
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/crypto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ Crypto.prototype.init = async function(opts) {
'readonly', [IndexedDBCryptoStore.STORE_ACCOUNT],
(txn) => {
this._cryptoStore.getCrossSigningKeys(txn, (keys) => {
if (keys) {
// can be an empty object after resetting cross-signing keys, see _storeTrustedSelfKeys
if (keys && Object.keys(keys).length !== 0) {
logger.log("Loaded cross-signing public keys from crypto store");
this._crossSigningInfo.setKeys(keys);
}
Expand Down

0 comments on commit 8992438

Please sign in to comment.