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

This commit is contained in:
Scott Nonnenberg
2017-11-14 16:37:44 -08:00
committed by GitHub
parent 0a2651c0a7
commit f0ec75eef4

View File

@@ -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);
});
},