Fix: scripts fail with user form missing

This commit is contained in:
Bartek Fabiszewski 2017-08-07 18:29:13 +02:00
parent 1b01926220
commit 4f2873ea20
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ function addUser() {
function editUser() { function editUser() {
var userForm = document.getElementsByName('user')[0]; var userForm = document.getElementsByName('user')[0];
var userLogin = userForm.options[userForm.selectedIndex].text; var userLogin = (userForm !== undefined) ? userForm.options[userForm.selectedIndex].text : auth;
if (userLogin == auth) { if (userLogin == auth) {
alert(lang['selfeditwarn']); alert(lang['selfeditwarn']);
return; return;

View File

@ -18,7 +18,7 @@
function editTrack() { function editTrack() {
var userForm = document.getElementsByName('user')[0]; var userForm = document.getElementsByName('user')[0];
var trackUser = userForm.options[userForm.selectedIndex].text; var trackUser = (userForm !== undefined) ? userForm.options[userForm.selectedIndex].text : auth;
if (trackUser != auth && !admin) { if (trackUser != auth && !admin) {
alert(lang['owntrackswarn']); alert(lang['owntrackswarn']);
return; return;