diff --git a/cedar-policy-core/src/est.rs b/cedar-policy-core/src/est.rs index ac0df81fa..2cfd0a8cc 100644 --- a/cedar-policy-core/src/est.rs +++ b/cedar-policy-core/src/est.rs @@ -146,12 +146,12 @@ impl TryFrom for Clause { let maybe_is_when = cond.cond.to_cond_is_when(); match cond.expr { None => { - let ident = maybe_is_when.map(|is_when| { + let maybe_ident = maybe_is_when.map(|is_when| { cst::Ident::Ident(if is_when { "when" } else { "unless" }.into()) - })?; + }); Err(cond .cond - .to_ast_err(ToASTErrorKind::EmptyClause(Some(ident))) + .to_ast_err(ToASTErrorKind::EmptyClause(maybe_ident.ok())) .into()) } Some(ref e) => {