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

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

Issue 396453004: Handle context == null in the analysis.getHover request. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/domain_analysis.dart
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index db34aa7a04de9562489632947b48e7268a68ff40..5b7cb443ea07314d7f18d69dba5a8bb559b0dd1d 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -41,11 +41,13 @@ class AnalysisDomainHandler implements RequestHandler {
{
Source source = server.getSource(file);
AnalysisContext context = server.getAnalysisContext(file);
- List<Source> librarySources = context.getLibrariesContaining(source);
- for (Source librarySource in librarySources) {
- CompilationUnit unit = context.resolveCompilationUnit2(source,
- librarySource);
- hovers.add(new DartUnitHoverComputer(unit, offset).compute());
+ if (context != null) {
+ List<Source> librarySources = context.getLibrariesContaining(source);
+ for (Source librarySource in librarySources) {
+ CompilationUnit unit = context.resolveCompilationUnit2(source,
+ librarySource);
+ hovers.add(new DartUnitHoverComputer(unit, offset).compute());
+ }
}
}
// send response
« 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