Index: pkg/analyzer/lib/src/task/dart.dart |
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart |
index dda846ed87436f6e8a4b3fbfaff581504faab386..5c50018a2fa379f511a16dabb08a2baccc99a270 100644 |
--- a/pkg/analyzer/lib/src/task/dart.dart |
+++ b/pkg/analyzer/lib/src/task/dart.dart |
@@ -1322,7 +1322,7 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask { |
Source partSource = partDirective.source; |
hasPartDirective = true; |
CompilationUnit partUnit = partUnitMap[partSource]; |
- if (partUnit != null) { |
+ if (partUnit != null && context.exists(partSource)) { |
CompilationUnitElementImpl partElement = partUnit.element; |
partElement.uriOffset = partUri.offset; |
partElement.uriEnd = partUri.end; |