Index: pkg/analysis_server/lib/src/analysis_server.dart |
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart |
index 5c73edf239025614800aa9382c38f4fbcf233696..99a0f7d72a862f6f1c9c18bbcfce92b568d69420 100644 |
--- a/pkg/analysis_server/lib/src/analysis_server.dart |
+++ b/pkg/analysis_server/lib/src/analysis_server.dart |
@@ -585,7 +585,9 @@ class AnalysisServer { |
} |
/** |
- * Return the analysis result for the file with the given [path]. |
+ * Return the analysis result for the file with the given [path]. The file is |
+ * analyzed in one of the analysis drivers to which the file was added, |
+ * otherwise in the first driver, otherwise `null` is returned. |
*/ |
Future<nd.AnalysisResult> getAnalysisResult(String path) async { |
nd.AnalysisResult result = priorityFileResults[path]; |
@@ -593,7 +595,7 @@ class AnalysisServer { |
return result; |
} |
nd.AnalysisDriver driver = getAnalysisDriver(path); |
- return driver.getResult(path); |
+ return driver?.getResult(path); |
} |
CompilationUnitElement getCompilationUnitElement(String file) { |