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

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

Issue 2085563002: Guard against missing element (issue 26685) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/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 995ec2756827c7dd8c11bf8d13dc315097fb652a..917542cdfb92623bc8264982406a531c26e18fa1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
@@ -556,7 +556,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
if (node.parent is VariableDeclaration) {
VariableDeclaration varDeclaration =
node.parent as VariableDeclaration;
- localTypeAssertion = varDeclaration.element.type;
+ localTypeAssertion = varDeclaration.element?.type;
} else if (node.parent is AssignmentExpression) {
AssignmentExpression assignmentExpression =
node.parent as AssignmentExpression;
« 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