diff --git a/src/commands/get.rs b/src/commands/get.rs index 3b9f578e..afa550c7 100644 --- a/src/commands/get.rs +++ b/src/commands/get.rs @@ -73,21 +73,20 @@ fn get_member(path: &Tagged, obj: &Tagged) -> Result current = Some(obj), - Tagged { - item: Value::Primitive(Primitive::Path(_)), - .. - } => current = Some(obj), - _ => {} - }; - match current { Some(v) => Ok(v.clone()), - None => Ok(Value::nothing().tagged(obj.tag)), + None => match obj { + // If its None check for certain values. + Tagged { + item: Value::Primitive(Primitive::String(_)), + .. + } => Ok(obj.clone()), + Tagged { + item: Value::Primitive(Primitive::Path(_)), + .. + } => Ok(obj.clone()), + _ => Ok(Value::nothing().tagged(obj.tag)), + }, } }