Check if element has two children before highlighting

This commit is contained in:
Mars Niermann 2023-03-08 10:15:01 +00:00
parent 80aa3d0f4b
commit b7c8d7821d

View file

@ -151,8 +151,10 @@
for (let i = 0; i < collection.length; i++) { for (let i = 0; i < collection.length; i++) {
let curr = collection[i]; let curr = collection[i];
if (curr.firstChild.firstChild.classList.contains("audiotrack")) { if (curr.firstChild.firstChild !== null) {
curr.style.backgroundColor = "rgba(251, 73, 52, 0.7)" if (curr.firstChild.firstChild.classList.contains("audiotrack")) {
curr.style.backgroundColor = "rgba(251, 73, 52, 0.7)"
}
} }
// Append buttons to list // Append buttons to list