Fix sortOnlineUserList might not check property existence before comparsion
This commit is contained in:
parent
fc788e805e
commit
ffa14cfeef
1 changed files with 4 additions and 4 deletions
|
@ -2946,14 +2946,14 @@ function sortOnlineUserList(list) {
|
||||||
else if (usera.idle && !userb.idle)
|
else if (usera.idle && !userb.idle)
|
||||||
return 1;
|
return 1;
|
||||||
else {
|
else {
|
||||||
if (usera.name && usera.name.toLowerCase() < userb.name.toLowerCase()) {
|
if (usera.name && userb.name && usera.name.toLowerCase() < userb.name.toLowerCase()) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (usera.name && usera.name.toLowerCase() > userb.name.toLowerCase()) {
|
} else if (usera.name && userb.name && usera.name.toLowerCase() > userb.name.toLowerCase()) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
if (usera.color && usera.color.toLowerCase() < userb.color.toLowerCase())
|
if (usera.color && userb.color && usera.color.toLowerCase() < userb.color.toLowerCase())
|
||||||
return -1;
|
return -1;
|
||||||
else if (usera.color && usera.color.toLowerCase() > userb.color.toLowerCase())
|
else if (usera.color && userb.color && usera.color.toLowerCase() > userb.color.toLowerCase())
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue