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

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

Issue 1156893006: Fix NPE when computing dependencies of enum constants (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/constant.dart
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index fa5360b8d87769eb4ed2ff81607308a243b8ea56..499ce5081f0fdeb33605d5dba3b169530a8452d8 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -418,7 +418,10 @@ class ConstantEvaluationEngine {
}
}
} else if (constant is PotentiallyConstVariableElement) {
- constant.constantInitializer.accept(referenceFinder);
+ Expression initializer = constant.constantInitializer;
+ if (initializer != null) {
+ initializer.accept(referenceFinder);
+ }
} else if (constant is ConstructorElementImpl) {
constant.isCycleFree = false;
ConstructorElement redirectedConstructor =
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698