Last Comment Bug 490749 - File/New/Saved Search produces exception, if no account/no folder is selected at folder pane (Error: folder is undefined Source File: chrome://messenger/content/folderPane.js Line: 1463)
: File/New/Saved Search produces exception, if no account/no folder is selected...
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Thunderbird 12.0
Assigned To: :aceman
Depends on:
  Show dependency treegraph
Reported: 2009-04-29 19:38 PDT by WADA
Modified: 2012-02-23 08:16 PST (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

fix (1.20 KB, patch)
2011-12-22 13:35 PST, :aceman
bwinton: review+
Details | Diff | Splinter Review

Description WADA 2009-04-29 19:38:31 PDT
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b5pre) Gecko/20090426 Shredder/3.0b3pre

When no account/no folder was selected at folder pane,
  Changed from initial "All Folders" mode to other mode, Unread/Favorite/Recent,
  Or returned to "All Folders")
File/New/Saved Search produced following exception.
> Error: folder is undefined
> Source File: chrome://messenger/content/folderPane.js Line: 1463
> (This exception occurs upon each "File/New/Saved Search")
Avobe exception didn't occur if account or folder is selected at folder pane.

Error: folder is undefined Source File: chrome://messenger/content/folderPane.js Line: 1463
Comment 1 Ludovic Hirlimann [:Usul] 2009-05-04 00:02:16 PDT
Wada is this a regression ?
Comment 2 WADA 2010-07-27 10:10:26 PDT
> Wada is this a regression ?

Sorry but I don't know. I happened to see the problem, and the problem was reproduced by very simple operation I stated in comment #0.
Comment 3 :aceman 2011-12-22 12:52:48 PST
This is still happening in TB12.

What should happen in this case? Just catch the exception and do nothing? Or show some prompt?
Comment 4 :aceman 2011-12-22 12:57:41 PST
I can do the clean exiting from the function. But if we want any UI stuff...
What about a status bar message? Is there something already available? There must be other cases where we want to tell "No folder selected" so I could reuse that?
Comment 5 Magnus Melin 2011-12-22 13:08:43 PST
I'd suggest if no folder is selected, fall back to the default account root, and show the dialog.
Comment 6 :aceman 2011-12-22 13:32:44 PST
Good idea. Patch coming.
Comment 7 :aceman 2011-12-22 13:35:59 PST
Created attachment 583921 [details] [diff] [review]
Comment 8 Blake Winton (:bwinton) (:☕️) 2011-12-23 07:48:53 PST
Comment on attachment 583921 [details] [diff] [review]

Since the UI isn't really changing, I don't think you need a ui-review from me.

So I'll give it a regular review instead.  ;)

The code looks pretty good.  The change is small and simple.  r=me.

Comment 9 :aceman 2011-12-23 07:54:01 PST
Comment 10 :aceman 2011-12-23 11:34:12 PST
Well, very similar problem happens when using Folders->Favorite, when there are none to show, the left tree pane is empty. Restarting TB comes up with the msgAccountCentral.js pane showing about every action available, because it does not know which account is selected (none is). Clicking most of the commands throws an exception like
Error: window.parent.MsgJunkMail is not a function
Source File: chrome://messenger/content/msgAccountCentral.js
Line: 292

Is this filed somewhere?
Comment 11 :aceman 2011-12-23 12:14:23 PST
Actually, that one bug is expected, that Junk feature is not ready, but was unintentionally exposed in the situation I described.
The real errors are
"Error: GetSelectedMsgFolder() is null"

Off to bug 713277.
Comment 12 Mark Banner (:standard8, limited time in Dec) 2011-12-31 10:48:04 PST
Checked in:

Note You need to log in before you can comment on or make changes to this bug.