Commit 747e25e8 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Fix devfs directory scanning to not attempt to scan non-existent directories (#10727)

parent 4739159e
......@@ -622,11 +622,15 @@ class DevFS {
final String packagePath = fs.path.fromUri(packageUri);
final Directory packageDirectory = fs.directory(packageUri);
Uri directoryUriOnDevice = fs.path.toUri(fs.path.join('packages', packageName) + fs.path.separator);
bool packageExists;
bool packageExists = packageDirectory.existsSync();
if (!packageExists) {
// If the package directory doesn't exist at all, we ignore it.
continue;
}
if (fs.path.isWithin(rootDirectory.path, packagePath)) {
// We already scanned everything under the root directory.
packageExists = packageDirectory.existsSync();
directoryUriOnDevice = fs.path.toUri(
fs.path.relative(packagePath, from: rootDirectory.path) + fs.path.separator
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment