Bug 1163299 - "TypeError: getBrowser(...) is null" in contentAreaClick with Lightning installed and started in calendar view; r=mkmellin
authorMakeMyDay <makemyday@gmx-topmail.de>
Sat, 09 May 2015 19:55:32 +0200
changeset 22591 38116ed2287cc5fbc3b913d6347953119321fed6
parent 22590 0631809c3173f19ee57ba2d5cb5c9c893f22fdcc
child 22592 e9b7b595cf81d9be3ad2d4f30dffcf8d9d7d231c
push id1420
push usermbanner@mozilla.com
push dateMon, 29 Jun 2015 20:47:24 +0000
treeherdercomm-beta@b3db00bb24e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmellin
bugs1163299
Bug 1163299 - "TypeError: getBrowser(...) is null" in contentAreaClick with Lightning installed and started in calendar view; r=mkmellin
mail/base/content/contentAreaClick.js
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -52,17 +52,18 @@
     }
 
     return href;
   }
 
 function messagePaneOnResize(aEvent)
 {
   // Scale any overflowing images, exclude http content.
-  let doc = getBrowser().contentDocument;
+  let browser = getBrowser();
+  let doc = browser && browser.contentDocument ? browser.contentDocument : null;
   if (!doc || doc.URL.startsWith("http") || !doc.images)
     return;
 
   for (let img of doc.images)
   {
     if (img.clientWidth - doc.body.offsetWidth >= 0 &&
         (img.clientWidth <= img.naturalWidth || !img.naturalWidth))
       img.setAttribute("overflowing", true);