Fixed server exception, #3292

This commit is contained in:
Ylian Saint-Hilaire 2021-11-22 10:23:18 -08:00
parent d915dea2e2
commit e22a5410eb
1 changed files with 1 additions and 1 deletions

View File

@ -1100,7 +1100,7 @@ function CreateMeshRelayEx2(parent, ws, req, domain, user, cookie) {
var agent = parent.wsagents[command.nodeid]; var agent = parent.wsagents[command.nodeid];
if (agent != null) { if (agent != null) {
// Check if we have permission to send a message to that node // Check if we have permission to send a message to that node
if (userid == null) { rights = MESHRIGHT_REMOTECONTROL; } else { rights = parent.GetNodeRights(user, routing.meshid, command.nodeid); } if (userid == null) { rights = MESHRIGHT_REMOTECONTROL; } else { rights = parent.GetNodeRights(user, agent.dbMeshKey, agent.dbNodeKey); }
mesh = parent.meshes[agent.dbMeshKey]; mesh = parent.meshes[agent.dbMeshKey];
if ((rights != null) && (mesh != null) || ((rights & 16) != 0)) { // TODO: 16 is console permission, may need more gradular permission checking if ((rights != null) && (mesh != null) || ((rights & 16) != 0)) { // TODO: 16 is console permission, may need more gradular permission checking
if (ws.sessionId) { command.sessionid = ws.sessionId; } // Set the session id, required for responses. if (ws.sessionId) { command.sessionid = ws.sessionId; } // Set the session id, required for responses.