Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1627)

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 3001023002: Guard against getting a watch event before the driver is created (issue 30333) (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 008ab6139f49895d535460b6c0b2fe465ebbbb60..7a6c0b99fd8b5da8e34bc9ebecdc09979255e46b 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -919,11 +919,14 @@ class ContextManagerImpl implements ContextManager {
String contextRoot = info.folder.path;
ContextBuilder builder =
callbacks.createContextBuilder(info.folder, defaultContextOptions);
- AnalysisOptions options = builder.getAnalysisOptions(contextRoot,
- contextRoot: info.analysisDriver?.contextRoot);
- SourceFactory factory = builder.createSourceFactory(contextRoot, options);
AnalysisDriver driver = info.analysisDriver;
- driver.configure(analysisOptions: options, sourceFactory: factory);
+ if (driver != null) {
+ AnalysisOptions options = builder.getAnalysisOptions(contextRoot,
+ contextRoot: driver.contextRoot);
+ SourceFactory factory =
+ builder.createSourceFactory(contextRoot, options);
+ driver.configure(analysisOptions: options, sourceFactory: factory);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698