Fix with try/catch

This commit is contained in:
Misthaa
2024-11-21 15:04:48 +01:00
parent c9ba4355ad
commit d83aaabab7

View File

@ -143,13 +143,19 @@ function searchUser(event)
function ajustSearchUserList() function ajustSearchUserList()
{ {
const searchInputUser = document.getElementById('searchInputUser'); try {
const pos = searchInputUser.getBoundingClientRect(); const searchInputUser = document.getElementById('searchInputUser');
const searchResult = document.getElementById('searchResult'); const pos = searchInputUser.getBoundingClientRect();
const searchResult = document.getElementById('searchResult');
searchResult.style.width = pos.width + 'px';
searchResult.style.top = pos.top + pos.height + 'px';
searchResult.style.left = pos.left + 'px';
}
catch {
// Do nothing
}
searchResult.style.width = pos.width + 'px';
searchResult.style.top = pos.top + pos.height + 'px';
searchResult.style.left = pos.left + 'px';
} }
function goBackHome() function goBackHome()
@ -380,12 +386,16 @@ function selectGameModeFour(event, disableScroll = false)
function movePopMenuLoginButton() function movePopMenuLoginButton()
{ {
const loginButton = document.getElementById('loginButton'); try {
const pos = loginButton.getBoundingClientRect(); const loginButton = document.getElementById('loginButton');
const popMenuLoginButton = document.getElementById('popMenuLoginButton'); const pos = loginButton.getBoundingClientRect();
const popMenuLoginButton = document.getElementById('popMenuLoginButton');
popMenuLoginButton.style.left = pos.left + "px"; popMenuLoginButton.style.left = pos.left + "px";
popMenuLoginButton.style.top = pos.top + pos.height + "px"; popMenuLoginButton.style.top = pos.top + pos.height + "px";
} catch {
// Do nothing
}
} }
function showMenu() function showMenu()