Merge pull request #3793 from matrix-org/dbkr/keyreq_dont_crash_if_removed

Don't crash if a keyshare request is removed
pull/21833/head
David Baker 2020-01-03 13:08:47 +00:00 committed by GitHub
commit bcece7dc10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -111,6 +111,12 @@ export default class KeyRequestHandler {
this._currentUser = null;
this._currentDevice = null;
if (!this._pendingKeyRequests[userId] || !this._pendingKeyRequests[userId][deviceId]) {
// request was removed in the time the dialog was displayed
this._processNextRequest();
return;
}
if (r) {
for (const req of this._pendingKeyRequests[userId][deviceId]) {
req.share();