guard against type error when placeholder querySelector is null

This commit is contained in:
ansuz 2022-08-22 15:49:06 +05:30
parent 1227fceba5
commit 2cc5a8ee82
1 changed files with 6 additions and 2 deletions

View File

@ -19,8 +19,12 @@ document.addEventListener('DOMContentLoaded', function() {
document.body.appendChild(elem);
// fallback if CSS animations not available
setTimeout(() => {
document.querySelector('.placeholder-logo-container').style.opacity = 100;
document.querySelector('.placeholder-message-container').style.opacity = 100;
try {
document.querySelector('.placeholder-logo-container').style.opacity = 100;
document.querySelector('.placeholder-message-container').style.opacity = 100;
} catch (err) {
console.error(err);
}
}, 3000);
});
}());