diff options
author | Mole Shang <[email protected]> | 2023-04-26 00:50:20 +0800 |
---|---|---|
committer | Mole Shang <[email protected]> | 2023-04-26 00:53:52 +0800 |
commit | cb965c28207f4cd40274abb7e5afec1c34621cb4 (patch) | |
tree | 2733570be13e63376de6aabe9276b5c79e0a7434 /head.html | |
parent | 0a54a8f14c885118f09b793b2489c1d907d54b8d (diff) | |
download | cgit-dark-cb965c28207f4cd40274abb7e5afec1c34621cb4.tar.gz cgit-dark-cb965c28207f4cd40274abb7e5afec1c34621cb4.tar.bz2 cgit-dark-cb965c28207f4cd40274abb7e5afec1c34621cb4.zip |
head.html: handle null header_td_form on homepage
Fixes:
Uncaught TypeError: header_td_form is null
Diffstat (limited to 'head.html')
-rw-r--r-- | head.html | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -16,10 +16,12 @@ tabs.className = "tabs"; forms.className = "forms"; var header_td_form = document.querySelector("table#header td.form"); - while (header_td_form.firstChild) { - header_form.appendChild(header_td_form.firstChild); + if (header_td_form) { + while (header_td_form.firstChild) { + header_form.appendChild(header_td_form.firstChild); + } + header_td_form.parentNode.removeChild(header_td_form); } - header_td_form.parentNode.removeChild(header_td_form); var tab_items = Array.from(document.querySelectorAll("table.tabs td")).map( (v) => { var div = document.createElement("div"); |