From 61fd16e461785770086f48d222cda1b011ec1056 Mon Sep 17 00:00:00 2001 From: Konstantin Merkel Date: Thu, 11 Jun 2026 16:43:15 +0200 Subject: [PATCH] fix(drag): prevent out of bounds matrix access --- lib/drag.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/drag.js b/lib/drag.js index afffd72..ca57b45 100644 --- a/lib/drag.js +++ b/lib/drag.js @@ -76,6 +76,7 @@ export class DragManager { if (hoveredSlot !== -1 && hoveredSlot !== originalSlot) { const matrix = layout.escalator.getLayoutForCount(tracker.size); + if (!matrix || hoveredSlot >= matrix.size || originalSlot >= matrix.size) return; const targetRect = matrix.getEstate(hoveredSlot).toAbsolute(monitorRect, gaps); indicator.set_position(targetRect.x, targetRect.y); @@ -120,6 +121,7 @@ export class DragManager { } _restoreWindowGeometry(tracker, matrix, slotToFind, targetEstateSlot, monitorRect, gaps) { + if (!matrix || targetEstateSlot >= matrix.size) return; const win = tracker.windows.find(w => tracker.getSlot(w) === slotToFind); if (!win) return; const wrap = this.controller._windowWrappers.get(win);