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

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

Issue 529313002: Fix for NPE in the server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | pkg/analysis_server/test/computer/element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index 5e3b33e100b85ad3835f30f8968a3651c46c96c0..779c6ec3bdb9b1a6648729c118f28e822038753d 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -294,6 +294,9 @@ Location _locationForArgs(engine.AnalysisContext context, engine.Source source,
Location _locationFromElement(engine.Element element) {
engine.AnalysisContext context = element.context;
engine.Source source = element.source;
+ if (context == null || source == null) {
+ return null;
+ }
String name = element.displayName;
int offset = element.nameOffset;
int length = name != null ? name.length : 0;
« no previous file with comments | « no previous file | pkg/analysis_server/test/computer/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698