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 = |