Closed Bug 1024908 Opened 8 years ago Closed 8 years ago

If the focus is returned to filter action list and the previously focused item is no longer there, an exception is shown

Categories

(MailNews Core :: Filters, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 33.0

People

(Reporter: aceman, Assigned: aceman)

References

Details

(Keywords: regression)

Attachments

(1 file)

STRs:
1. create 2 filter actions
2. make sure the second one is the last one that was edited (it has focus)
3. click into the filter rules list above.
4. click "-" to remove the second filter action
5. click the actions list again.

Result:
Error: TypeError: gFilterActionList.getItemAtIndex(...) is null
Source File: chrome://messenger/content/FilterEditor.js
Line: 784

Cause:

function setLastActionFocus() {
  let lastAction = gFilterActionList.getAttribute("focusedAction");
  gFilterActionList.getItemAtIndex(lastAction).mRuleActionType.menulist.focus();
}

This was introduced by bug 825449.

lastAction points to a no longer existing row, e.g. the last item that was removed via the "-" button. Removal of rows does not update "focusedAction" attribute.
Attached patch patchSplinter Review
Attachment #8440105 - Flags: review?(mkmelin+mozilla)
Attachment #8440105 - Flags: review?(mkmelin+mozilla) → review+
Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/0943fb1fd946
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 33.0
You need to log in before you can comment on or make changes to this bug.