Safe readdir() use for pathMaps

This commit is contained in:
Thomas Wilburn 2015-03-24 17:26:11 -07:00
parent a28955c011
commit 90d07c4ffa
2 changed files with 5 additions and 4 deletions

View file

@ -100,6 +100,7 @@ define([
}, done)
},
readdir: function(done) {
if (!this.isDir) return done();
//TODO: track entries, compare to existing, do not duplicate
var self = this;
var reader = this.entry.createReader();

View file

@ -36,10 +36,10 @@ define([
//after initial render, do the walk for path lookup
root.walk(function(node, c) {
pathMap[node.entry.fullPath] = node;
//make sure the children are read and populated
node.readdir(function() {
c();
});
//make sure the children are read and populated, then continue
if (node.isDir) {
node.readdir(c);
} else c();
});
});
setVisible();