Don't remove negative indexes

This commit is contained in:
Tor Hedin Brønner
2017-09-09 16:16:56 +02:00
parent 9346d52826
commit 783df4e037
+2
View File
@@ -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: