If the user doesn't have permission on a file/dir, utils.walkdir results in an Uncaught TypeError because res is null.
if (stats && stats.isDirectory()) {
utils.walkdir(filepath, base, function(err, res) {
res.forEach(function(dirEntry) {
results.push(dirEntry);
});
next();
});
}
If the user doesn't have permission on a file/dir,
utils.walkdirresults in anUncaught TypeErrorbecauseresis null.