Index: lib/filesystem/io.js |
=================================================================== |
--- a/lib/filesystem/io.js |
+++ b/lib/filesystem/io.js |
@@ -181,22 +181,26 @@ var IO = exports.IO = |
exists: true, |
isDirectory: false, |
isFile: true, |
lastModified: 0 |
})); |
return; |
} |
- this._getFileEntry(file, false, function(fs, fileEntry) |
- { |
- fileEntry.getMetadata(function(metadata) |
+ // This needs to use Utils.runAsync(), otherwise FilterStorage might |
+ // initialize too early - see #337. |
+ require("utils").Utils.runAsync(function() { |
+ this._getFileEntry(file, false, function(fs, fileEntry) |
{ |
- callback(null, { |
- exists: true, |
- isDirectory: fileEntry.isDirectory, |
- isFile: fileEntry.isFile, |
- lastModified: metadata.modificationTime.getTime() |
- }); |
+ fileEntry.getMetadata(function(metadata) |
+ { |
+ callback(null, { |
+ exists: true, |
+ isDirectory: fileEntry.isDirectory, |
+ isFile: fileEntry.isFile, |
+ lastModified: metadata.modificationTime.getTime() |
+ }); |
+ }, callback); |
}, callback); |
- }, callback); |
+ }.bind(this)); |
} |
}; |