fix realname undefined #6118

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-05-24 10:54:27 +01:00
parent 49b561260a
commit 6c685d5557

View File

@ -818,8 +818,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Patch node links with names, like meshes links with names
for (var a in docs[i].links) {
if (!docs[i].links[a].name) {
if (parent.users[a].realname) { docs[i].links[a].name = parent.users[a].realname; }
else if (parent.users[a].name) { docs[i].links[a].name = parent.users[a].name; }
if (parent.users[a] && parent.users[a].realname) { docs[i].links[a].name = parent.users[a].realname; }
else if (parent.users[a] && parent.users[a].name) { docs[i].links[a].name = parent.users[a].name; }
}
}