Bug 1489302 - Port Bug 1488084 [fix TypeError: getBrowser() is null in mailWindow.js] to SeaMonkey. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sun, 09 Sep 2018 15:16:29 +0200
changeset 28296 0b6424ff09a7b688e7935e220aa930ffd0835287
parent 28295 7bc9cc8c2c1adf486f84ef60ac8df4a2535007c1
child 28297 6b4a44972c3b4276a6adcfcce3732ef6247d5ce9
push id2123
push userfrgrahl@gmx.net
push dateSun, 09 Sep 2018 13:16:56 +0000
treeherdercomm-esr52@0b6424ff09a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1489302, 1488084
Bug 1489302 - Port Bug 1488084 [fix TypeError: getBrowser() is null in mailWindow.js] to SeaMonkey. r=IanN a=IanN
suite/mailnews/mailWindow.js
--- a/suite/mailnews/mailWindow.js
+++ b/suite/mailnews/mailWindow.js
@@ -61,18 +61,18 @@ function OnMailWindowUnload()
   msgWindow.closeWindow();
 }
 
 /**
  * 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) {
     // We're only interested if this is in the message content.
     return; 
   }
 
   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