mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 580814 - Avoid accessing rows that don't exist in treeviews for Places. r=mak
This commit is contained in:
parent
d77dae5390
commit
664e1bfd0d
@ -198,7 +198,8 @@ PlacesTreeView.prototype = {
|
||||
* @return [parentNode, parentRow]
|
||||
*/
|
||||
_getParentByChildRow: function PTV__getParentByChildRow(aChildRow) {
|
||||
let parent = this._getNodeForRow(aChildRow).parent;
|
||||
let node = this._getNodeForRow(aChildRow);
|
||||
let parent = (node === null) ? this._rootNode : node.parent;
|
||||
|
||||
// The root node is never visible
|
||||
if (parent == this._rootNode)
|
||||
@ -212,6 +213,10 @@ PlacesTreeView.prototype = {
|
||||
* Gets the node at a given row.
|
||||
*/
|
||||
_getNodeForRow: function PTV__getNodeForRow(aRow) {
|
||||
if (aRow < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let node = this._rows[aRow];
|
||||
if (node !== undefined)
|
||||
return node;
|
||||
|
Loading…
Reference in New Issue
Block a user