# HG changeset patch # User HIROSE Yuuji # Date 1653747523 -32400 # Node ID 39ef64b5654de3745a6f586fe9ef78800d21b9a3 # Parent 072362c47306f34c4cc012369b64f7a457c5f344 Check ID existence diff -r 072362c47306 -r 39ef64b5654d s4-main.js --- a/s4-main.js Sat May 28 22:58:06 2022 +0900 +++ b/s4-main.js Sat May 28 23:18:43 2022 +0900 @@ -1035,13 +1035,16 @@ } function initReplyHover() { function getTextById(id) { - let repltd = document.getElementById(id), - txt = repltd.innerText, - authtd = repltd.parentNode.getElementsByTagName("td")[0], - authAs = authtd.getElementsByTagName("a"), - author = authAs[authAs.length-1].innerText, - digest = txt.split("\n").splice(0, hoverTextLines).join("\n"); - return "[[ "+author+" ]]\n"+digest; + let repltd = document.getElementById(id); + if (repltd) { + let txt = repltd.innerText, + authtd = repltd.parentNode.getElementsByTagName("td")[0], + authAs = authtd.getElementsByTagName("a"), + author = authAs[authAs.length-1].innerText, + digest = txt.split("\n").splice(0, hoverTextLines).join("\n"); + return "[[ "+author+" ]]\n"+digest; + } else + return ""; } for (let td of document.querySelectorAll("td.repl")) { let text = td.innerHTML;