rem: if (line > this.rowCount) line = this.rowCount; 
add: if (line >= this.rowCount) line = this.rowCount - 1; 
context: function bov_scrollto (line, align){    if (!this.tree)        return;        var headerRows = 1;        var first = this.tree.getFirstVisibleRow();    var last  = this.tree.getLastVisibleRow();    var viz   = last - first - headerRows; /* total number of visible rows */    /* all rows are visible, nothing to scroll */    if (first == 0 && last > this.rowCount)        return;        /* tree lines are 0 based, we accept one based lines, deal with it */    --line;    /* safety clamp */    if (line < 0)        line = 0;    if (line > this.rowCount)        line = this.rowCount;        if (align < 0)    {        if (line > this.rowCount - viz) /* overscroll, can't put a row from */            line = this.rowCount - viz; /* last page at the top. */        this.tree.scrollToRow(line);    }    else if (align > 0)    {        if (line < viz) /* underscroll, can't put a row from the first page */            line = 0;   /* at the bottom. */        else            line = line - viz + headerRows;                this.tree.scrollToRow(line);    }    else    {        var half_viz = viz / 2;        /* lines past this line can't be centered without causing the tree         * to show more rows than we have. */        var lastCenterable = this.rowCount - half_viz;        if (line > lastCenterable)            line = lastCenterable;        /* lines before this can't be centered without causing the tree         * to attempt to display negative rows. */        else if (line < half_viz)            line = half_viz;        this.tree.scrollToRow(line - half_viz);    }                    }       
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/6b866a92208c3fedf42bd2e47303c1aa4424e1cc/tree-utils.js/buggy/extensions/venkman/resources/content/tree-utils.js