From 783df4e03787b47fce7e7f7d4dda992f801f024d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sat, 9 Sep 2017 16:16:56 +0200 Subject: [PATCH] Don't remove negative indexes --- tiling.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tiling.js b/tiling.js index b4111d3..c76d7b1 100644 --- a/tiling.js +++ b/tiling.js @@ -156,6 +156,8 @@ remove_handler = (ws, meta_window) => { // window has already received the `focus` signal at this point. let removed_i = pages.indexOf(meta_window) + if (removed_i < 0) + return pages.splice(removed_i, 1) // At this point the `focus` index might be invalid so we correct it: