Bug 1600507 - Deal with null gMsgFolderSelected. r=frg a=frg CLOSED TREE
authorIan Neal <iann_cvs@blueyonder.co.uk>
Thu, 12 Dec 2019 19:52:32 +0100
changeset 32386 f5f430ed547d7364ae44d29e4d9ceb9be04fed33
parent 32385 f103e65e5a6e2a02fe1b8b1f3bd9df9d025e6ef8
child 32387 6f606bccc2528de8f4e3828acedfa4e464e930cc
push id232
push userfrgrahl@gmx.net
push dateThu, 12 Dec 2019 18:52:58 +0000
treeherdercomm-esr60@6f606bccc252 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1600507
Bug 1600507 - Deal with null gMsgFolderSelected. r=frg a=frg CLOSED TREE
suite/mailnews/content/msgMail3PaneWindow.js
--- a/suite/mailnews/content/msgMail3PaneWindow.js
+++ b/suite/mailnews/content/msgMail3PaneWindow.js
@@ -210,34 +210,38 @@ var folderListener =
             // Scroll to message for virtual folders is done in
             // gSearchNotificationListener.OnSearchDone (see searchBar.js).
             if (!scrolled && !(gMsgFolderSelected.flags & nsMsgFolderFlags.Virtual))
               ScrollToMessageAfterFolderLoad(msgFolder);
             SetBusyCursor(window, false);
           }
           // Folder loading is over,
           // now issue quick search if there is an email address.
-          viewDebug("in folder loaded gVirtualFolderTerms = " + gVirtualFolderTerms + "\n");
-          viewDebug("in folder loaded gMsgFolderSelected = " +
-                    gMsgFolderSelected && gMsgFolderSelected.URI + "\n");
+          if (gVirtualFolderTerms)
+            viewDebug("in folder loaded gVirtualFolderTerms = " +
+                      gVirtualFolderTerms + "\n");
+          if (gMsgFolderSelected)
+            viewDebug("in folder loaded gMsgFolderSelected = " +
+                      gMsgFolderSelected.URI + "\n");
           if (rerootingFolder)
           {
             if (gSearchEmailAddress)
             {
               Search(gSearchEmailAddress);
               gSearchEmailAddress = null;
             }
             else if (gVirtualFolderTerms)
             {
               gDefaultSearchViewTerms = null;
               viewDebug("searching gVirtualFolderTerms\n");
               gDBView.viewFolder = gMsgFolderSelected;
               ViewChangeByFolder(gMsgFolderSelected);
             }
-            else if (gMsgFolderSelected.flags & nsMsgFolderFlags.Virtual)
+            else if (gMsgFolderSelected &&
+                     gMsgFolderSelected.flags & nsMsgFolderFlags.Virtual)
             {
               viewDebug("selected folder is virtual\n");
               gDefaultSearchViewTerms = null;
             }
             else
             {
               // Get the view value from the folder.
               if (msgFolder)