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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.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 | « pkg/analysis_server/lib/src/computer/computer_navigation.dart ('k') | 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/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 26caf44a99f7368d6778230746f27831abcad2a1..74d483efdfc89d764b24c507f18740968d0e46e1 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -230,6 +230,11 @@ NavigationTarget newNavigationTarget_fromElement(engine.Element element,
int fileToIndex(String file)) {
ElementKind kind = newElementKind_fromEngine(element.kind);
Location location = newLocation_fromElement(element);
+ // TODO(scheglov) Fix the enclosing element problem in the incremental
+ // resolver and remove this.
+ if (location == null) {
+ return null;
+ }
String file = location.file;
int fileIndex = fileToIndex(file);
return new NavigationTarget(
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_navigation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698