Error: col.value is null Source File: chrome://global/content/bindings/tree.xml Line: 1140

NEW
Unassigned

Status

()

Core
XP Toolkit/Widgets: XUL
7 years ago
5 years ago

People

(Reporter: crussell, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

0. Make sure strict JS error reporting is turned on.
1. Get at any tree which has at least one row which is a container and where the tree has few enough rows for there to be extra whitespace in the treebody after the last row (e.g., the Firefox history sidebar, with the browser sized large enough).
2. Select a container row, (e.g., "Today").
3. Double click in the whitespace after the last row.

Results:
Error: col.value is null
Source File: chrome://global/content/bindings/tree.xml
Line: 1140

> 1129 > var col = {};
> 1130 > var obj = {};
> 1131 > tbo.getCellAt(event.clientX, event.clientY, {}, col, obj);
> 1132 > 
> 1133 > if (obj.value != "twisty")
> 1134 >   this.parentNode.startEditing(row, col.value);
> 1135 > 
> 1136 > if (this.parentNode._editingColumn || !tbo.view.isContainer(row))
> 1137 >   return;
> 1138 > 
> 1139 > // Cyclers and twisties respond to single clicks, not double clicks
> 1140 > if (col.value != -1 && !col.value.cycler && obj.value != "twisty")
> 1141 >   this.parentNode.changeOpenState(row);

The troublesome bit is the check for |col.value != -1|.  |col.value| isn't expected to be an index, so -1 is the wrong thing to be checking for.  It should be an nsITreeColumn or null.
Assignee: nobody → Sevenspade
Assignee: Sevenspade → nobody
You need to log in before you can comment on or make changes to this bug.