diff --git a/cli/src/templater.rs b/cli/src/templater.rs index 4aa2f9291..c588d0bf8 100644 --- a/cli/src/templater.rs +++ b/cli/src/templater.rs @@ -620,12 +620,11 @@ impl TemplateProperty for PropertyPlaceholder { type Output = O; fn extract(&self) -> Result { - Ok(self - .value - .borrow() - .as_ref() - .expect("placeholder value must be set before evaluating template") - .clone()) + if let Some(value) = self.value.borrow().as_ref() { + Ok(value.clone()) + } else { + Err(TemplatePropertyError("Placeholder value is not set".into())) + } } }