| Index: pkg/analysis_server/lib/src/services/completion/dart/optype.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
|
| index 3a5608c856cbf96ea93e7c24f9976d170a1eca13..ea97679577cae9f42325d362da95c296d5143088 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
|
| @@ -211,8 +211,9 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
|
| optype.includeTypeNameSuggestions = true;
|
| optype.typeNameSuggestionsFilter = (DartType dartType, int relevance) {
|
| DartType staticType = node.expression.staticType;
|
| - if (staticType.isDynamic ||
|
| - (dartType.isSubtypeOf(staticType) && dartType != staticType)) {
|
| + if (staticType != null &&
|
| + (staticType.isDynamic ||
|
| + (dartType.isSubtypeOf(staticType) && dartType != staticType))) {
|
| return relevance;
|
| } else {
|
| return null;
|
| @@ -592,8 +593,9 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
|
| optype.includeTypeNameSuggestions = true;
|
| optype.typeNameSuggestionsFilter = (DartType dartType, int relevance) {
|
| DartType staticType = node.expression.staticType;
|
| - if (staticType.isDynamic ||
|
| - (dartType.isSubtypeOf(staticType) && dartType != staticType)) {
|
| + if (staticType != null &&
|
| + (staticType.isDynamic ||
|
| + (dartType.isSubtypeOf(staticType) && dartType != staticType))) {
|
| return relevance;
|
| } else {
|
| return null;
|
|
|