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

Side by Side Diff: pkg/analysis_server/lib/src/domain_analysis.dart

Issue 2668523002: Add missed return leading to an NPE (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library domain.analysis; 5 library domain.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core'; 8 import 'dart:core';
9 9
10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart'; 10 import 'package:analysis_server/plugin/analysis/analysis_domain.dart';
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 .toResponse(request.id)); 166 .toResponse(request.id));
167 } 167 }
168 } 168 }
169 return; 169 return;
170 } 170 }
171 171
172 Future<AnalysisDoneReason> analysisFuture = 172 Future<AnalysisDoneReason> analysisFuture =
173 server.onFileAnalysisComplete(file); 173 server.onFileAnalysisComplete(file);
174 if (analysisFuture == null) { 174 if (analysisFuture == null) {
175 server.sendResponse(new Response.getNavigationInvalidFile(request)); 175 server.sendResponse(new Response.getNavigationInvalidFile(request));
176 return;
176 } 177 }
177 analysisFuture.then((AnalysisDoneReason reason) async { 178 analysisFuture.then((AnalysisDoneReason reason) async {
178 switch (reason) { 179 switch (reason) {
179 case AnalysisDoneReason.COMPLETE: 180 case AnalysisDoneReason.COMPLETE:
180 CompilationUnit unit = await server.getResolvedCompilationUnit(file); 181 CompilationUnit unit = await server.getResolvedCompilationUnit(file);
181 if (unit == null) { 182 if (unit == null) {
182 server.sendResponse(new Response.getNavigationInvalidFile(request)); 183 server.sendResponse(new Response.getNavigationInvalidFile(request));
183 } else { 184 } else {
184 CompilationUnitElement unitElement = unit.element; 185 CompilationUnitElement unitElement = unit.element;
185 NavigationCollectorImpl collector = computeNavigation( 186 NavigationCollectorImpl collector = computeNavigation(
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 context.onResultChanged(descriptor).listen((result) { 441 context.onResultChanged(descriptor).listen((result) {
441 StreamController<engine.ResultChangedEvent> controller = 442 StreamController<engine.ResultChangedEvent> controller =
442 controllers[result.descriptor]; 443 controllers[result.descriptor];
443 if (controller != null) { 444 if (controller != null) {
444 controller.add(result); 445 controller.add(result);
445 } 446 }
446 }); 447 });
447 } 448 }
448 } 449 }
449 } 450 }
OLDNEW
« 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