Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
index 49d3353c24f60c65fe9d1d3d95b8fa79575096c2..e7595b4edf6ce7356be00eba242a431ba46ed1e9 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
@@ -1681,7 +1681,11 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive> |
} |
ConstantValue getConstantForVariable(VariableElement element) { |
- return irBuilder.state.constants.getConstantValue(element.constant); |
+ ConstantExpression constant = element.constant; |
+ if (constant != null) { |
+ return irBuilder.state.constants.getConstantValue(constant); |
+ } |
+ return null; |
} |
ir.Primitive buildConstantExpression( |