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

Unified Diff: pkg/analyzer/lib/src/dart/constant/evaluation.dart

Issue 2112873003: Patch to work around exception until the root cause is found (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/analyzer/lib/src/dart/constant/evaluation.dart
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index da2db5551640abb588293d10c67fc6c99ec14154..30d69951d061ce4012478e844ba134ebe28f6d8c 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -347,7 +347,13 @@ class ConstantEvaluationEngine {
// This could happen in the event of invalid code. The error will be
// reported at constant evaluation time.
}
- if (constNode.arguments != null) {
+ if (constNode == null) {
+ // We cannot determine what element the annotation is on, nor the offset
+ // of the annotation, so there's not a lot of information in this
+ // message, but it's better than getting an exception.
+ AnalysisEngine.instance.logger.logInformation(
+ 'No annotationAst for $constant in ${constant.compilationUnit}');
+ } else if (constNode.arguments != null) {
constNode.arguments.accept(referenceFinder);
}
} else if (constant is VariableElement) {
« 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