Bug 1253931 - Don't access gFolderDisplay when it's null. r=mkmelin a=rkent
authorJorg K
Fri, 11 Mar 2016 15:39:07 -0800
changeset 24185 0c4109ac2b8a472cbfb58ea375756a4533fcf3fb
parent 24184 d67233a60c72871f2b4f5271f38a2b9ec0a2072a
child 24186 f19c1ba0792add3d74062aa55c538405861e2814
push id1596
push userkent@caspia.com
push dateWed, 16 Mar 2016 18:57:42 +0000
treeherdercomm-beta@f19c1ba0792a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, rkent
bugs1253931
Bug 1253931 - Don't access gFolderDisplay when it's null. r=mkmelin a=rkent
mail/base/content/mail3PaneWindowCommands.js
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -1111,16 +1111,19 @@ function GetNumSelectedMessages()
   // This global function is only for mailnews/ compatibility.
   return gFolderDisplay.selectedCount;
 }
 
 var gLastFocusedElement=null;
 
 function FocusRingUpdate_Mail()
 {
+  if (!gFolderDisplay)
+    return;
+
   // if the focusedElement is null, we're here on a blur.
   // nsFocusController::Blur() calls nsFocusController::SetFocusedElement(null),
   // which will update any commands listening for "focus".
   // we really only care about nsFocusController::Focus() happens,
   // which calls nsFocusController::SetFocusedElement(element)
   var currentFocusedElement = gFolderDisplay.focusedPane;
 
   if (currentFocusedElement != gLastFocusedElement) {