if no nodes return nothing for getDeviceDetails #6637

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2025-01-03 16:59:29 +00:00
parent d1cb184e9e
commit e66776c5da

View File

@ -8049,6 +8049,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
parent.common.unEscapeAllLinksFieldName(docs);
var results = [], resultPendingCount = 0;
if (docs.length == 0) { // no results return blank array
func(docs, type);
} else {
for (i in docs) {
// Check device links, if a link points to an unknown user, remove it.
parent.cleanDevice(docs[i]);
@ -8086,6 +8089,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
getNodeFunc.nodeid = docs[i]._id;
parent.GetNodeWithRights(domain, user, docs[i]._id, getNodeFunc);
}
}
});
} else {
// If we are paging, we know what devices the user is look at