mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-04-01 10:13:38 -04:00
Fixed server exception, #4030
This commit is contained in:
parent
fe3ee25054
commit
7b364d48b0
10
meshuser.js
10
meshuser.js
@ -7274,10 +7274,12 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
function readFilesRec(path) {
|
function readFilesRec(path) {
|
||||||
var r = {}, dir = fs.readdirSync(path);
|
var r = {}, dir = fs.readdirSync(path);
|
||||||
for (var i in dir) {
|
for (var i in dir) {
|
||||||
var f = { t: 3, d: 111 };
|
var f = { t: 3, d: 111 }, stat = null;
|
||||||
var stat = fs.statSync(path + '/' + dir[i]);
|
try { stat = fs.statSync(path + '/' + dir[i]); } catch (ex) { }
|
||||||
if ((stat.mode & 0x004000) == 0) { f.s = stat.size; f.d = stat.mtime.getTime(); } else { f.t = 2; f.f = readFilesRec(path + '/' + dir[i]); }
|
if (stat != null) {
|
||||||
r[dir[i]] = f;
|
if ((stat.mode & 0x004000) == 0) { f.s = stat.size; f.d = stat.mtime.getTime(); } else { f.t = 2; f.f = readFilesRec(path + '/' + dir[i]); }
|
||||||
|
r[dir[i]] = f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user