mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Fixed server exception, #4030
This commit is contained in:
		
							parent
							
								
									fe3ee25054
								
							
						
					
					
						commit
						7b364d48b0
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		
							
								
								
									
										10
									
								
								meshuser.js
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								meshuser.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -7274,10 +7274,12 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
 | 
			
		|||
    function readFilesRec(path) {
 | 
			
		||||
        var r = {}, dir = fs.readdirSync(path);
 | 
			
		||||
        for (var i in dir) {
 | 
			
		||||
            var f = { t: 3, d: 111 };
 | 
			
		||||
            var stat = fs.statSync(path + '/' + dir[i]);
 | 
			
		||||
            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;
 | 
			
		||||
            var f = { t: 3, d: 111 }, stat = null;
 | 
			
		||||
            try { stat = fs.statSync(path + '/' + dir[i]); } catch (ex) { }
 | 
			
		||||
            if (stat != null) {
 | 
			
		||||
                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;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue