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

Unified Diff: pkg/analysis_server/lib/src/computer/computer_navigation.dart

Issue 774543002: Fix for NPE in navigation after some incremental changes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | pkg/analysis_server/lib/src/protocol_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/computer/computer_navigation.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
index ab0d8547f53b5cb462b1c4da2deb29dcb1c06b02..0c14dd699aa22a0cd36e5b8e3fa7b47a377d3e36 100644
--- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
@@ -44,6 +44,11 @@ class DartUnitNavigationComputer {
return;
}
int targetIndex = _addTarget(element);
+ // TODO(scheglov) Fix the enclosing element problem in the incremental
+ // resolver and remove this.
+ if (targetIndex == null) {
+ return;
+ }
regions.add(
new protocol.NavigationRegion(offset, length, <int>[targetIndex]));
}
@@ -54,6 +59,11 @@ class DartUnitNavigationComputer {
index = targets.length;
protocol.NavigationTarget target =
protocol.newNavigationTarget_fromElement(element, _addFile);
+ // TODO(scheglov) Fix the enclosing element problem in the incremental
+ // resolver and remove this.
+ if (target == null) {
+ return null;
+ }
targets.add(target);
targetMap[element] = index;
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698