main.js: handle undefined styleName in style chooser

This commit is contained in:
Zankaria 2024-08-07 22:49:04 +02:00
parent 14272c87e9
commit 17f92344e9

View file

@ -216,6 +216,7 @@ function initStyleChooser() {
newElement.className = 'styles';
for (styleName in styles) {
if (styleName) {
var style = document.createElement('a');
style.innerHTML = '[' + styleName + ']';
style.onclick = function() {
@ -227,6 +228,7 @@ function initStyleChooser() {
style.href = 'javascript:void(0);';
newElement.appendChild(style);
}
}
document.getElementById('bottom-hud').before(newElement);
}