From b01d21484f752c19cd2f3df3d50e90e45868bcb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Thu, 10 Jan 2019 19:24:29 +0100 Subject: [PATCH] Bugfix: Tolerate removal of monitor while extension is disabled NPE in setMonitor if old monitor was gone on enable. Eg. suspend, disconnect monitor, resume --- tiling.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index 47e56cd..9991fb8 100644 --- a/tiling.js +++ b/tiling.js @@ -180,7 +180,9 @@ class Space extends Array { let oldSpace = oldSpaces.get(workspace); this.targetX = 0; if (oldSpace) { - monitor = Main.layoutManager.monitors[oldSpace.monitor.index]; + let oldMonitor = Main.layoutManager.monitors[oldSpace.monitor.index]; + if (oldMonitor) + monitor = oldMonitor; } this.setMonitor(monitor, false);