Skip to content

Commit

Permalink
Fix unhandle exception when access ElementAnnotationImpl.constantValue
Browse files Browse the repository at this point in the history
  • Loading branch information
kunzhao77 authored and kevmoo committed Feb 16, 2016
1 parent c3d98ac commit 7199398
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/analyzer/lib/src/dart/element/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7199398

Please sign in to comment.