removeSignedPrekey: Be resilient to delete returning nothing (#1769)
This commit is contained in:
parent
0a2651c0a7
commit
f0ec75eef4
1 changed files with 7 additions and 4 deletions
|
@ -267,10 +267,13 @@
|
|||
},
|
||||
removeSignedPreKey: function(keyId) {
|
||||
var prekey = new SignedPreKey({id: keyId});
|
||||
return new Promise(function(resolve) {
|
||||
prekey.destroy().then(function() {
|
||||
resolve();
|
||||
});
|
||||
return new Promise(function(resolve, reject) {
|
||||
var deferred = prekey.destroy();
|
||||
if (!deferred) {
|
||||
return resolve();
|
||||
}
|
||||
|
||||
deferred.then(resolve, reject);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue