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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 1693223002: Fix unhandle exception when access ElementAnnotationImpl.constantValue (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 07e45f86b767b8fc4bb4bb8a776462571c6e348b..0fa3e6a2aebbdeeeb82514f63898fff87abf8bc0 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1221,7 +1221,7 @@ class ConstFieldElementImpl extends FieldElementImpl with ConstVariableElement {
ConstFieldElementImpl.forNode(Identifier name) : super.forNode(name);
@override
- DartObject get constantValue => _result.value;
+ DartObject get constantValue => _result?.value;
@override
EvaluationResultImpl get evaluationResult => _result;
@@ -1255,7 +1255,7 @@ class ConstLocalVariableElementImpl extends LocalVariableElementImpl
ConstLocalVariableElementImpl.forNode(Identifier name) : super.forNode(name);
@override
- DartObject get constantValue => _result.value;
+ DartObject get constantValue => _result?.value;
@override
EvaluationResultImpl get evaluationResult => _result;
@@ -1414,7 +1414,7 @@ class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl
: super.forNode(name);
@override
- DartObject get constantValue => _result.value;
+ DartObject get constantValue => _result?.value;
@override
EvaluationResultImpl get evaluationResult => _result;
@@ -1473,7 +1473,7 @@ class DefaultFieldFormalParameterElementImpl
: super.forNode(name);
@override
- DartObject get constantValue => _result.value;
+ DartObject get constantValue => _result?.value;
@override
EvaluationResultImpl get evaluationResult => _result;
@@ -1507,7 +1507,7 @@ class DefaultParameterElementImpl extends ParameterElementImpl
DefaultParameterElementImpl.forNode(Identifier name) : super.forNode(name);
@override
- DartObject get constantValue => _result.value;
+ DartObject get constantValue => _result?.value;
@override
EvaluationResultImpl get evaluationResult => _result;
@@ -1610,7 +1610,7 @@ class ElementAnnotationImpl implements ElementAnnotation {
ElementAnnotationImpl(this.compilationUnit);
@override
- DartObject get constantValue => evaluationResult.value;
+ DartObject get constantValue => evaluationResult?.value;
@override
AnalysisContext get context => compilationUnit.library.context;
« 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