guard against possible type error, lint compliance

This commit is contained in:
ansuz 2022-07-13 19:28:59 +05:30
parent 24ccb6d9e7
commit 96a12d12a9
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,6 @@
(function () {
var logoPath = '/customize/CryptPad_logo.svg';
if (location.pathname == '/' || location.pathname == '/index.html') {
if (location.pathname === '/' || location.pathname === '/index.html') {
logoPath = '/customize/CryptPad_logo_hero.svg';
}
@ -14,6 +15,7 @@ elem.innerHTML = [
'</div>'
].join('');
document.addEventListener('DOMContentLoaded', function(e) {
document.addEventListener('DOMContentLoaded', function() {
document.body.appendChild(elem);
});
}());

View File

@ -1955,7 +1955,10 @@ define([
rtStarted = true;
// Remove the outer placeholder once iframe overwrites it for sure
document.querySelector('#placeholder').remove();
var placeholder = document.querySelector('#placeholder');
if (placeholder && typeof(placeholder.remove) === 'function') {
placeholder.remove();
}
var replaceHash = function (hash) {
// The pad has just been created but is not stored yet. We'll switch