Bug 639995 - "cmd_collapseAllThreads command: TypeError: gDBView is null" opening View menu with account selected. r+moa=Mnyromyr
authorJens Hatlak <jh@junetz.de>
Fri, 11 Mar 2011 00:23:19 +0100
changeset 7319 83d38f9f13c6fe4672b1d0ff0b11776e0cb4b92b
parent 7318 6609dcc741a7c1b64ddb375a1155db718723ac75
child 7320 25d7a188c85d603ec25a67d3bd15f049e5f670f1
push idunknown
push userunknown
push dateunknown
bugs639995
Bug 639995 - "cmd_collapseAllThreads command: TypeError: gDBView is null" opening View menu with account selected. r+moa=Mnyromyr
suite/mailnews/mail3PaneWindowCommands.js
--- a/suite/mailnews/mail3PaneWindowCommands.js
+++ b/suite/mailnews/mail3PaneWindowCommands.js
@@ -434,17 +434,17 @@ var DefaultController =
       case "cmd_selectAll":
       case "cmd_selectFlagged":
         return gDBView != null;
       // these are enabled on when we are in threaded mode
       case "cmd_selectThread":
         if (GetNumSelectedMessages() <= 0) return false;
       case "cmd_expandAllThreads":
       case "cmd_collapseAllThreads":
-        return (gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay);
+        return gDBView && (gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay);
         break;
       case "cmd_nextFlaggedMsg":
       case "cmd_previousFlaggedMsg":
         return IsViewNavigationItemEnabled();
       case "cmd_viewAllMsgs":
       case "cmd_viewUnreadMsgs":
       case "cmd_viewIgnoredThreads":
         return gDBView;