Bug 1584383 - Fix fetch size checking. r+a=jorgk
authoralta88@fixall.com
Sat, 28 Sep 2019 21:31:44 +0200
changeset 35893 eb3420625ac088f281ed413d91cacd0b33bd656e
parent 35892 159260ce893112b3a5219a505a788cbcaa0e0186
child 35894 786073dcb3052a788c29ab438a196b4aa6fb7906
push id36
push usermozilla@jorgk.com
push dateSun, 29 Sep 2019 20:32:49 +0000
treeherdercomm-esr68@aded7ab29145 [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
@@ -2190,19 +2190,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(