follow on fix for 402365, tabs break calendar view, r=bienvenu
authorbugmail@asutherland.org
Thu, 09 Oct 2008 08:15:14 -0700
changeset 563 42022c4cfd55068a8969646783ebe6a2605ca074
parent 562 1103d4d826c7cfe74c7a585b2329c50c74101fad
child 564 38cb09a53f4c88f9a0347dfb9b3a866f344f5bae
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs402365
follow on fix for 402365, tabs break calendar view, r=bienvenu
mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -1357,16 +1357,18 @@ let mailTabType = {
       },
       showTab: function(aTab) {
         this.folderAndThreadPaneVisible = true;
         ClearMessagePane();
 
         this.showTab(aTab);
       },
       onTitleChanged: function(aTab, aTabNode) {
+        if (!gMsgFolderSelected)
+          return;
         aTab.title = gMsgFolderSelected.prettyName;
         // the user may have changed folders, triggering our onTitleChanged callback.
         // update the appropriate attributes on the tab.
         aTabNode.setAttribute('SpecialFolder', getSpecialFolderString(gMsgFolderSelected));
         aTabNode.setAttribute('ServerType', gMsgFolderSelected.server.type);
       }
     },
     message: {
@@ -1434,26 +1436,29 @@ let mailTabType = {
       aTab.messenger.setWindow(null, null);
   },
 
   saveTabState: function(aTab) {
     aTab.messenger = messenger;
     aTab.dbView = gDBView;
     aTab.searchSession = gSearchSession;
 
+    if (!gDBView)
+      return;
+      
     if (gDBView.currentlyDisplayedMessage != nsMsgViewIndex_None)
-  {
+    {
       try // there may not be a selected message.
-    {
+      {
         var curMsgHdr = gDBView.hdrForFirstSelectedMessage;
         aTab.selectedMsgId = curMsgHdr.messageId;
         aTab.msgSelectedFolder = curMsgHdr.folder;
-    }
+      }
       catch (ex)
-  {
+      {
         aTab.msgSelectedFolder = gMsgFolderSelected
       }
     }
     else
   {
       aTab.selectedMsgId = null;
       aTab.msgSelectedFolder = null;
     }