Fixed server exception, #3292

Ylian Saint-Hilaire committed Nov 22, 2021 at 10:23 UTC e22a5410eb8e887ccff31232276f3c7ce6b4a2be
1 file changed +1 -1
meshdesktopmultiplex.js
+1 -1
@@ -1100,7 +1100,7 @@ function CreateMeshRelayEx2(parent, ws, req, domain, user, cookie) {
1100 var agent = parent.wsagents[command.nodeid];
1101 if (agent != null) {
1102 // Check if we have permission to send a message to that node
1103 - if (userid == null) { rights = MESHRIGHT_REMOTECONTROL; } else { rights = parent.GetNodeRights(user, routing.meshid, command.nodeid); }
1103 + if (userid == null) { rights = MESHRIGHT_REMOTECONTROL; } else { rights = parent.GetNodeRights(user, agent.dbMeshKey, agent.dbNodeKey); }
1104 mesh = parent.meshes[agent.dbMeshKey];
1105 if ((rights != null) && (mesh != null) || ((rights & 16) != 0)) { // TODO: 16 is console permission, may need more gradular permission checking
1106 if (ws.sessionId) { command.sessionid = ws.sessionId; } // Set the session id, required for responses.