summaryrefslogtreecommitdiff
path: root/head.html
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2023-04-26 00:50:20 +0800
committerMole Shang <[email protected]>2023-04-26 00:53:52 +0800
commitcb965c28207f4cd40274abb7e5afec1c34621cb4 (patch)
tree2733570be13e63376de6aabe9276b5c79e0a7434 /head.html
parent0a54a8f14c885118f09b793b2489c1d907d54b8d (diff)
downloadcgit-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.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/head.html b/head.html
index 7ee78be..3796203 100644
--- a/head.html
+++ b/head.html
@@ -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");