diff --git a/files/assets/js/sort_table.js b/files/assets/js/sort_table.js index 973837e83..214b49222 100644 --- a/files/assets/js/sort_table.js +++ b/files/assets/js/sort_table.js @@ -7,16 +7,12 @@ function sort_table(n) { rows = table.rows; for (i = 1; i < (rows.length - 1); i++) { shouldSwitch = false; - x = rows[i].getElementsByTagName("TD")[n]; - y = rows[i + 1].getElementsByTagName("TD")[n]; - const x_child = x.getElementsByTagName('a') - if (x_child) { - x = x_child[0] - } - const y_child = y.getElementsByTagName('a') - if (y_child) { - y = y_child[0] - } + let x = rows[i].getElementsByTagName("TD")[n]; + let y = rows[i + 1].getElementsByTagName("TD")[n]; + const x_child = x.getElementsByTagName('a')[0] + if (typeof x_child != 'undefined') x = x_child + const y_child = y.getElementsByTagName('a')[0] + if (typeof y_child != 'undefined') y = y_child if (parseInt(x.innerHTML) < parseInt(y.innerHTML)) { shouldSwitch = true; break; diff --git a/files/templates/admins.html b/files/templates/admins.html index 83207579b..4ca577087 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -4,7 +4,7 @@ {% block content %} - +