From 363c436b338f00026ea273a476b3dbad20f2dfb9 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 5 Jun 2015 17:13:18 -0700 Subject: [PATCH] Handle single-error rejections when sending messages We can not assume that we will get back an error array. Closes #258 // FREEBIE --- js/models/conversations.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/models/conversations.js b/js/models/conversations.js index 9cf7dffd6..ffb773476 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -100,6 +100,9 @@ message.unset('pending'); message.save(); }.bind(this)).catch(function(errors) { + if (errors instanceof Error) { + errors = [errors]; + } var keyErrors = []; _.each(errors, function(e) { if (e.error.name === 'OutgoingIdentityKeyError') {