Get new position safely

This commit is contained in:
Piro / YUKI Hiroshi 2014-07-02 04:44:02 +09:00
parent f4fb6174d2
commit ca776a606f

View File

@ -4049,7 +4049,8 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
var newPos = -1; var newPos = -1;
if (parentOfNext) { if (parentOfNext) {
let descendants = this.getDescendantTabs(parentOfNext); let descendants = this.getDescendantTabs(parentOfNext);
newPos = descendants[descendants.length-1]._tPos; if (descendants.length)
newPos = descendants[descendants.length-1]._tPos;
} }
else if (aNextTab) { else if (aNextTab) {
newPos = aNextTab._tPos; newPos = aNextTab._tPos;