From 48e74b0b097aa6cf0212b12e583d311c69acdf33 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sat, 2 Apr 2022 13:28:10 -0400 Subject: [PATCH] Check if panel monitor overview alloc fixes #1592 --- overview.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/overview.js b/overview.js index 1cd0dc4..9ab37be 100644 --- a/overview.js +++ b/overview.js @@ -690,17 +690,20 @@ var Overview = class { let startX = -xOff; let startY = -yOff; const panel = Utils.find(global.dashToPanel.panels, p => p.monitor.index == this._monitorIndex); - switch (panel.getPosition()) { - case St.Side.TOP: - yOff += panel.panelBox.height; - startY -= panel.panelBox.height; - break; - case St.Side.BOTTOM: - yOff += panel.panelBox.height; - break; - case St.Side.RIGHT: - xOff += panel.panelBox.width; - break; + + if (panel) { + switch (panel.getPosition()) { + case St.Side.TOP: + yOff += panel.panelBox.height; + startY -= panel.panelBox.height; + break; + case St.Side.BOTTOM: + yOff += panel.panelBox.height; + break; + case St.Side.RIGHT: + xOff += panel.panelBox.width; + break; + } } contentBox.set_origin(startX, startY); contentBox.set_size(xOff + contentWidth, yOff + contentHeight);