Bug 1584383 - Fix fetch size checking. r+a=jorgk
authoralta88@fixall.com
Sat, 28 Sep 2019 21:31:44 +0200
changeset 35798 798aaad4b69f7ff4efa0dd673b1c5f5731813256
parent 35797 1916b830e430e2839b8271d0821c14fc30c7deb8
child 35799 f88fe6789a40e9162fa2a6a89510a86bb7d70870
push id2499
push usermozilla@jorgk.com
push dateSat, 28 Sep 2019 22:18:19 +0000
treeherdercomm-beta@d632dc260a51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1584383
Bug 1584383 - Fix fetch size checking. r+a=jorgk
mail/base/content/msgHdrView.js
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -2126,19 +2126,19 @@ AttachmentInfo.prototype = {
         } else {
           // Check the attachment again if addAttachmentField() sets a
           // libmime -1 return value for size in this object.
           // Note: just test for a non zero size, don't need to drain the
           // stream. We only get here if the url is fetchable.
           // The size for internal attachments is not calculated here but
           // will come from libmime.
           let reader = response.body.getReader();
-          let { value: chunk } = await reader.read();
+          let result = await reader.read();
           reader.cancel();
-          size = chunk && chunk.value ? chunk.value.length : -1;
+          size = result && result.value ? result.value.length : -1;
         }
 
         if (size > 0) {
           empty = false;
         }
       })
       .catch(error => {
         console.warn(