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 = |