Fixed checking code.

This commit is contained in:
Ylian Saint-Hilaire 2019-09-25 15:09:40 -07:00
parent ee3936af32
commit f4afd7a8ea

View File

@ -908,7 +908,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Check that the user has access to this nodeid // Check that the user has access to this nodeid
if (obj.user.links == null) return; if (obj.user.links == null) return;
db.Get(command.nodeid, function (err, nodes) { db.Get(command.nodeid, function (err, nodes) {
if ((node == null) || (nodes.length != 1)) return; if ((nodes == null) || (nodes.length != 1)) return;
const node = nodes[0]; const node = nodes[0];
var meshlink = obj.user.links[node.meshid]; var meshlink = obj.user.links[node.meshid];
@ -1987,7 +1987,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// For each nodeid, change the group // For each nodeid, change the group
for (var i = 0; i < command.nodeids.length; i++) { for (var i = 0; i < command.nodeids.length; i++) {
db.Get(command.nodeids[i], function (err, nodes) { db.Get(command.nodeids[i], function (err, nodes) {
if ((node == null) || (nodes.length != 1)) return; if ((nodes == null) || (nodes.length != 1)) return;
const node = nodes[0]; const node = nodes[0];
// Check if already in the right mesh // Check if already in the right mesh