From 06c70b0ff4dd1f959280288908744787b25fdab1 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 13 Apr 2018 16:18:01 -0700 Subject: [PATCH] Don't fail message load if we can't load quote thumbnail --- libtextsecure/message_receiver.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 060b1eb96..1bd9dac1b 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1016,8 +1016,17 @@ MessageReceiver.prototype.extend({ for (let i = 0, max = attachments.length; i < max; i += 1) { const attachment = attachments[i]; - if (attachment.thumbnail) { - promises.push(this.handleAttachment(attachment.thumbnail)); + const { thumbnail } = attachment; + + if (thumbnail) { + // We don't want the failure of a thumbnail download to fail the handling of + // this message entirely, like we do for full attachments. + promises.push(this.handleAttachment(thumbnail).catch(function(error) {} + console.log( + 'Problem loading thumbnail for quote', + error && error.stack ? error.stack : error, + )); + })); } } }