Bug 1488084 - fix TypeError: getBrowser() is null in mailWindow.js. r=mkmelin a=jorgk BETA_60_CONTINUATION
authorJorg K <jorgk@jorgk.com>
Sun, 02 Sep 2018 22:13:54 +0200
branchBETA_60_CONTINUATION
changeset 32460 09c4e2c198c3
parent 32459 370e9fd8b362
child 32461 5bae0c9b333a
push id385
push userclokep@gmail.com
push dateTue, 04 Sep 2018 23:26:14 +0000
reviewersmkmelin, jorgk
bugs1488084
Bug 1488084 - fix TypeError: getBrowser() is null in mailWindow.js. r=mkmelin a=jorgk
mail/base/content/mailWindow.js
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -54,18 +54,18 @@ function OnMailWindowUnload()
 }
 
 
 /**
  * When copying/dragging, convert imap/mailbox URLs of images into data URLs so
  * that the images can be accessed in a paste elsewhere.
  */
 function onCopyOrDragStart(e) {
-  let sourceDoc = getBrowser().contentDocument;
-  if (e.target.ownerDocument != sourceDoc) {
+  let browser = getBrowser();
+  if (!browser || e.target.ownerDocument != browser.contentDocument) {
     return; // We're only interested if this is in the message content.
   }
 
   let imgMap = new Map(); // Mapping img.src -> dataURL.
 
   // For copy, the data of what is to be copied is not accessible at this point.
   // Figure out what images are a) part of the selection and b) visible in
   // the current document. If their source isn't http or data already, convert