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);