Out of bounds checking for array access

This fixes a crasher in v4, without backtrace. Trying to reproduce it
in a simpler case, but this at least makes PageStack work.
This commit is contained in:
Sebastian Kügler 2013-10-28 04:20:52 +01:00
parent 51de1b4a59
commit 79ad02c244

View File

@ -70,7 +70,10 @@ function push(page, properties, replace, immediate) {
}
// get the current container
var oldContainer = pageStack[pageStack.length - 1];
var oldContainer;
if (pageStack.length) {
oldContainer = pageStack[pageStack.length - 1];
}
// pop the old container off the stack if this is a replace
if (oldContainer && replace) {