Index: pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart |
index 2a537bf072ce120e426fd1e2c20807a13ac1aed6..a57319a6dbce03a064a77ff7500771b04d3764b1 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart |
@@ -29,6 +29,9 @@ CompletionSuggestion createSuggestion(Element element, |
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, |
int relevance: DART_RELEVANCE_DEFAULT, |
Source importForSource}) { |
+ if (element == null) { |
+ return null; |
+ } |
if (element is ExecutableElement && element.isOperator) { |
// Do not include operators in suggestions |
return null; |