Typing 8 when a message is selected produces an error in the console

RESOLVED FIXED in Thunderbird 16.0

Status

Thunderbird
Mail Window Front End
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Usul, Assigned: aceman)

Tracking

Trunk
Thunderbird 16.0
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

990 bytes, patch
Details | Diff | Splinter Review
(Reporter)

Description

5 years ago
Select a message , press 8

in the error console you get the following error

Timestamp: 6/6/12 11:13:48 AM
Error: An error occurred executing the cmd_tag8 command: TypeError: tagArray[keyNumber - 1] is undefined
Source File: chrome://global/content/globalOverlay.js
Line: 79
(Reporter)

Updated

5 years ago
OS: Mac OS X → All
(Assignee)

Comment 1

5 years ago
Actually it adds a tag for me, that is in the context menu under Tags and has a accesskey of 8.
This probably just needs a check if there is a tag defined under that number. I'll try it.
Assignee: nobody → acelists
(Assignee)

Comment 2

5 years ago
Note to me:
http://mxr.mozilla.org/comm-central/source/mail/base/content/mailWindowOverlay.js#566

if (tagArray.length < keyNumber)
  return;
(Assignee)

Comment 3

5 years ago
Created attachment 631091 [details] [diff] [review]
patch
Attachment #631091 - Flags: review?(mconley)
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
Hardware: x86 → All
Comment on attachment 631091 [details] [diff] [review]
patch

Review of attachment 631091 [details] [diff] [review]:
-----------------------------------------------------------------

Just one super tiny nit. With that fixed, r=me.

::: mail/base/content/mailWindowOverlay.js
@@ +562,5 @@
>    if (!msgHdr)
>      return;
>  
>    let tagArray = MailServices.tags.getAllTags({});
> +  if (tagArray.length < keyNumber)

Sorry for being super super picky, but I think I'd prefer

if (keyNumber > tagArray.length)

I know they're semantically equivalent, but I think it reads easier based on what's expected; "the keynumber the user pressed was out of range" as opposed to "the expected range is outside of the keynumber".
Attachment #631091 - Flags: review?(mconley) → review+
(Assignee)

Comment 5

5 years ago
Created attachment 632386 [details] [diff] [review]
patch v2

What a nit ;)
Attachment #631091 - Attachment is obsolete: true
(Assignee)

Comment 6

5 years ago
Usul, try to verify once this lands.
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/ac54b600e9ce
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
You need to log in before you can comment on or make changes to this bug.