From e7d4bafecfdc2f43fb8ee35fd304964d448f7d10 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 28 Oct 2024 16:05:14 -0400 Subject: [PATCH] Produce better error log when panZoom entry is not found --- web/skins/classic/views/js/montage.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/views/js/montage.js b/web/skins/classic/views/js/montage.js index 884b94d4d..9f4fb4284 100644 --- a/web/skins/classic/views/js/montage.js +++ b/web/skins/classic/views/js/montage.js @@ -663,9 +663,14 @@ function fullscreenchanged(event) { objBtn.children('.material-icons').html('fullscreen'); } //Sometimes the positioning is not correct, so it is better to reset Pan & Zoom - zmPanZoom.panZoom[stringToNumber(event.target.id)].reset(); + const monitorId = stringToNumber(event.target.id); + if (monitorId && zmPanZoom.panZoom[monitorId]) { + zmPanZoom.panZoom[monitorId].reset(); + } else { + console.err("No panZoom found for ", monitorId, event); + } } -} +} // end function fullscreenchanged(event) function calculateAverageMonitorsRatio(arrRatioMonitors) { //Let's calculate the average Ratio value for the displayed monitors