From 4e861620ce025ebf5791a5aecefa3d44e6b835ef Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 3 Jan 2024 15:36:03 -0500 Subject: [PATCH] Fix identifier bug --- src/abstract_tree/identifier.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/abstract_tree/identifier.rs b/src/abstract_tree/identifier.rs index feac63e..ceaabbd 100644 --- a/src/abstract_tree/identifier.rs +++ b/src/abstract_tree/identifier.rs @@ -37,10 +37,12 @@ impl AbstractTree for Identifier { fn run(&self, _source: &str, context: &Map) -> Result { if let Some((value, _)) = context.variables()?.get(&self.0) { - Ok(value.clone()) - } else { - Err(Error::VariableIdentifierNotFound(self.inner().clone())) + if !value.is_none() { + return Ok(value.clone()); + } } + + Err(Error::VariableIdentifierNotFound(self.0.clone())) } fn expected_type(&self, context: &Map) -> Result {