Bug 1584383 - Fix fetch size checking. r=jorgk
authoralta88@fixall.com
Sat, 28 Sep 2019 21:31:44 +0200
changeset 27778 57f0f8a7f2426b4be35fd5af8f8471c3dc8c26a4
parent 27777 20f327d46fb9d8fef174c7d2fb2a9d60ecc1b675
child 27779 629098a84b46e290ab42efad51d5204fd5784335
push id16484
push usermozilla@jorgk.com
push dateSat, 28 Sep 2019 19:37:06 +0000
treeherdercomm-central@57f0f8a7f242 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1584383
Bug 1584383 - Fix fetch size checking. r=jorgk
mail/base/content/msgHdrView.js
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -2149,19 +2149,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(