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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart

Issue 1688493002: Fix NPE in completion contributor (issue 25711) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 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/services/completion/dart/type_member_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
index 257527b3b8dacce981100fa525b1aee305b82332..7a0f76020fec1538ac517427ef3f02a9cef28dc1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart
@@ -72,7 +72,8 @@ class TypeMemberContributor extends DartCompletionContributor {
} else if (elem is LocalVariableElement) {
type = elem.type;
}
- if (type.isDynamic && expression is SimpleIdentifier) {
+ if ((type == null || type.isDynamic) &&
+ expression is SimpleIdentifier) {
// If the element does not provide a good type
// then attempt to get a better type from a local declaration
_LocalBestTypeVisitor visitor =
« 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