diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index a8a7f23bae..4d85ae39ef 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -801,19 +801,18 @@ MessageReceiver.prototype.extend({ .then(plaintext => { const { isMe, isBlocked } = plaintext || {}; if (isMe || isBlocked) { - return this.removeFromCache(envelope); + this.removeFromCache(envelope); + return null; } - return this.updateCache(envelope, plaintext).then( - () => plaintext, - error => { - window.log.error( - 'decrypt failed to save decrypted message contents to cache:', - error && error.stack ? error.stack : error - ); - return plaintext; - } - ); + this.updateCache(envelope, plaintext).catch(error => { + window.log.error( + 'decrypt failed to save decrypted message contents to cache:', + error && error.stack ? error.stack : error + ); + }); + + return plaintext; }) .catch(error => { let errorToThrow = error;