Bug 921311 - Fix out-of-bounds index in session history collection (r=ttaubert)

This commit is contained in:
Bill McCloskey 2013-09-27 17:58:59 -07:00
parent 945f83d0c7
commit d95776b1fb

View File

@ -74,7 +74,9 @@ let SessionHistoryInternal = {
debug("SessionStore failed gathering complete history " +
"for the focused window/tab. See bug 669196.");
}
data.index = history.index + 1;
// Ensure the index isn't out of bounds if an exception was thrown above.
data.index = Math.min(history.index + 1, data.entries.length);
} else {
let uri = webNavigation.currentURI.spec;
// We landed here because the history is inaccessible or there are no