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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart

Issue 2290233006: Fix a null pointer exception (found in a log) (Closed)
Patch Set: Created 4 years, 4 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/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
index 7687117b36d54a71dbf15007a4ea95185733ee6e..d0b063660db93e55268c624273aaa83e5c5fa164 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart
@@ -217,6 +217,7 @@ class _LocalVisitor extends LocalDeclarationVisitor {
int code = data.codeUnitAt(index);
return isLetterOrDigit(code) || code == CHAR_UNDERSCORE;
}
+
if (isIdentifierChar(offset - 1)) {
while (offset > 0 && isIdentifierChar(offset - 1)) {
--offset;
@@ -488,7 +489,7 @@ class _LocalVisitor extends LocalDeclarationVisitor {
bool isDeprecated: false,
int relevance: DART_RELEVANCE_DEFAULT}) {
relevance = optype.returnValueSuggestionsFilter(
- enumDeclaration.element.type, relevance);
+ enumDeclaration.element?.type, relevance);
if (relevance != null) {
_addLocalSuggestion_enumConstant(constantDeclaration, enumDeclaration,
isAbstract: isAbstract,
« 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