From 6ec89ecb908d18007f2021aa398bc09607f79f4a Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 2 Oct 2021 15:14:01 +0100 Subject: [PATCH] bugfix-retry: only try to go to a line if the line actually exists --- src/static/js/broadcast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index 93b80dac3..6ba263cd2 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -173,7 +173,7 @@ const loadBroadcastJS = (socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro const goToLineNumber = (lineNumber) => { // Sets the Y scrolling of the browser to go to this line const line = $('#innerdocbody').find(`div:nth-child(${lineNumber + 1})`); - if (line) { + if (line && $(line)[0]) { const newY = $(line)[0].offsetTop; const ecb = document.getElementById('editorcontainerbox'); // Chrome 55 - 59 bugfix