зеркало из https://github.com/mozilla/pjs.git
Bug 580814 - Avoid accessing rows that don't exist in treeviews for Places. r=mak
This commit is contained in:
Родитель
74f4120e75
Коммит
7d9e28804c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче