Bug 376581 - ASSERT: null node when deleting last history item. patch from onemen.one@gmail.com, r=me.

This commit is contained in:
mozilla.mano@sent.com 2007-04-23 16:38:04 -07:00
parent 436a51a9c7
commit b833653cb5

View File

@ -947,8 +947,18 @@
<method name="restoreSelection">
<body><![CDATA[
var allowedMaxIndex = this.view.rowCount - 1;
for (var i = 0; i < this._nextSelection.length; ++i) {
var range = this._nextSelection[i];
// make sure the index is not over the end of the view
// this fixes bug 376581
if (range.max > allowedMaxIndex)
range.max = allowedMaxIndex;
if (range.min > allowedMaxIndex)
range.min = allowedMaxIndex;
if (range.min > -1 && range.max > -1)
this.view.selection.rangedSelect(range.min, range.max, true);
}