Fix +10613 don't crash when there is not a next panel

pull/227/head
Ruben Daniels 2015-12-03 10:54:53 +00:00 zatwierdzone przez nightwing
rodzic 235e674419
commit 33e8b0ca57
1 zmienionych plików z 27 dodań i 25 usunięć

Wyświetl plik

@ -585,32 +585,34 @@ define(function(require, module, exports) {
next = next.selectNodes("tab|hsplitbox|vsplitbox")[op](); next = next.selectNodes("tab|hsplitbox|vsplitbox")[op]();
} }
// move all pages to another pane if (next) {
getTabs().forEach(function(tab) { // move all pages to another pane
tab.attachTo(next.cloud9pane, null, true); getTabs().forEach(function(tab) {
}); tab.attachTo(next.cloud9pane, null, true);
});
// destroy aml element // destroy aml element
amlPane.destroy(true, true); amlPane.destroy(true, true);
// Clean up tree // Clean up tree
if (last) { if (last) {
var place = parent.nextSibling; var place = parent.nextSibling;
var grandpa = parent.parentNode; var grandpa = parent.parentNode;
parent.removeChild(last); parent.removeChild(last);
if (parent != options.container) if (parent != options.container)
parent.destroy(true, true); parent.destroy(true, true);
grandpa.insertBefore(last, place); grandpa.insertBefore(last, place);
queue = [grandpa] queue = [grandpa]
var size = grandpa.$vbox ? "height" : "width"; var size = grandpa.$vbox ? "height" : "width";
last.setAttribute(size, parent[size]); last.setAttribute(size, parent[size]);
size = grandpa.$vbox ? "width" : "height"; size = grandpa.$vbox ? "width" : "height";
last.setAttribute(size, ""); last.setAttribute(size, "");
} }
else { else {
queue = [parent]; queue = [parent];
}
} }
if (last && last.parentNode.localName == "bar") { if (last && last.parentNode.localName == "bar") {