Skip to content
Snippets Groups Projects
Commit 07625c7b authored by Fabian Homborg's avatar Fabian Homborg
Browse files

HalfLayout: Bail early when trying to remove invalid tileindex

parent 5f819d85
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,10 @@ HalfLayout.prototype.removeTile = function(tileIndex) {
//FIXME: There is a crash here
// Remove the array entry
var oldrect = this.tiles[tileIndex].rectangle;
if (tileIndex < 0 || tileIndex >= this.tiles.length) {
print("Removing invalid tileindex");
return;
}
this.tiles.splice(tileIndex, 1);
// Update the other tiles
if (this.tiles.length == 1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment