Fixed checking code.

Ylian Saint-Hilaire committed Sep 25, 2019 at 15:09 UTC f4afd7a8eade662b04c43a7f336bb8300c7b6261
1 file changed +2 -2
meshuser.js
+2 -2
@@ -908,7 +908,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
908 // Check that the user has access to this nodeid
909 if (obj.user.links == null) return;
910 db.Get(command.nodeid, function (err, nodes) {
911 - if ((node == null) || (nodes.length != 1)) return;
911 + if ((nodes == null) || (nodes.length != 1)) return;
912 const node = nodes[0];
913
914 var meshlink = obj.user.links[node.meshid];
@@ -1987,7 +1987,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
1987 // For each nodeid, change the group
1988 for (var i = 0; i < command.nodeids.length; i++) {
1989 db.Get(command.nodeids[i], function (err, nodes) {
1990 - if ((node == null) || (nodes.length != 1)) return;
1990 + if ((nodes == null) || (nodes.length != 1)) return;
1991 const node = nodes[0];
1992
1993 // Check if already in the right mesh