catch if given atree does not exist

This commit is contained in:
reschan 2022-06-24 09:50:18 +07:00
parent 32ee15dc2b
commit cba1bb5eb0

View file

@ -5,6 +5,8 @@ function construct_AT(elem, tree) {
document.getElementById("atree-active").innerHTML = ""; //reset all atree actives - should be done in a more general way later document.getElementById("atree-active").innerHTML = ""; //reset all atree actives - should be done in a more general way later
elem.innerHTML = ""; //reset the atree in the DOM elem.innerHTML = ""; //reset the atree in the DOM
if (tree === undefined) {return false;}
// add in the "Active" title to atree // add in the "Active" title to atree
let active_row = document.createElement("div"); let active_row = document.createElement("div");
active_row.classList.add("row", "item-title", "mx-auto", "justify-content-center"); active_row.classList.add("row", "item-title", "mx-auto", "justify-content-center");