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

Unified Diff: pkg/analyzer_plugin/lib/src/utilities/completion/completion_target.dart

Issue 2974533002: Guard against an AST node with no end token (issue 30089) (Closed)
Patch Set: Created 3 years, 5 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/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
« 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