Index: pkg/analyzer_cli/lib/src/build_mode.dart |
diff --git a/pkg/analyzer_cli/lib/src/build_mode.dart b/pkg/analyzer_cli/lib/src/build_mode.dart |
index e60ec098ec7f47828fdc7d9ea4a026c72727bf4a..d49a5198c88de8fc4c4442b4cd939db9ee60df54 100644 |
--- a/pkg/analyzer_cli/lib/src/build_mode.dart |
+++ b/pkg/analyzer_cli/lib/src/build_mode.dart |
@@ -324,6 +324,11 @@ class BuildMode { |
// Parse the source and serialize its AST. |
Uri uri = Uri.parse(absoluteUri); |
Source source = context.sourceFactory.forUri2(uri); |
+ if (!source.exists()) { |
+ // TODO(paulberry): we should report a warning/error because DDC |
+ // compilations are unlikely to work. |
+ return null; |
+ } |
return uriToUnit.putIfAbsent(uri, () { |
CompilationUnit unit = context.computeResult(source, PARSED_UNIT); |
UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit); |