Index: pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart |
diff --git a/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart b/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart |
index b825a8447bd49e569c6d662096989d710dfaba58..431384112e3111404ab4fa9c32e5cab54f8c8d73 100644 |
--- a/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart |
+++ b/pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart |
@@ -451,6 +451,9 @@ class CompletionTarget { |
* [CompletionTarget] associated with the given [offset]. |
*/ |
static bool _isCandidateToken(Token token, int offset) { |
+ if (token == null) { |
+ return false; |
+ } |
// A token is considered a candidate entity if the cursor offset is (a) |
// before the start of the token, (b) within the token, (c) at the end of |
// the token and the token is a keyword or identifier, or (d) at the |