removeSignedPrekey: Be resilient to delete returning nothing (#1769)

pull/749/head
Scott Nonnenberg 7 years ago committed by GitHub
parent 0a2651c0a7
commit f0ec75eef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save