Index: tools/migration/lib/src/io.dart |
diff --git a/tools/migration/lib/src/io.dart b/tools/migration/lib/src/io.dart |
index 83cb1bc5efb10139aab8e49deb9f60fcf530967e..0e97c46f0cbcecb1c4a4b9833d20d8f006131196 100644 |
--- a/tools/migration/lib/src/io.dart |
+++ b/tools/migration/lib/src/io.dart |
@@ -48,11 +48,14 @@ void deleteFile(String path) { |
/// assumed to be relative to the SDK's "tests" directory and having file |
/// [extension]. |
Iterable<String> listFiles(String dir, {String extension = ".dart"}) { |
- return new Directory(p.join(testRoot, dir)) |
- .listSync(recursive: true) |
- .map((entry) { |
- if (!entry.path.endsWith(extension)) return null; |
- |
- return entry.path; |
- }).where((path) => path != null); |
+ try { |
+ return new Directory(p.join(testRoot, dir)) |
+ .listSync(recursive: true) |
+ .map((entry) { |
+ if (!entry.path.endsWith(extension)) return null; |
+ return entry.path; |
+ }).where((path) => path != null); |
+ } catch (FileSystemException) { |
+ return []; |
+ } |
} |